1 | const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
2 | const webpack = require('webpack');
|
3 | const autoprefixer = require('autoprefixer');
|
4 | const CopyWebpackPlugin = require('copy-webpack-plugin');
|
5 |
|
6 | const config = {
|
7 | debug: false,
|
8 | entry: [
|
9 |
|
10 | __dirname + '/src/HugeTable.less',
|
11 | ],
|
12 | output: {
|
13 | path: __dirname + '/dist',
|
14 | filename: 'main.js',
|
15 | publicPath: '/',
|
16 | },
|
17 | module: {
|
18 | loaders: [
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | {
|
25 | test: /\.less$/,
|
26 | loader: ExtractTextPlugin.extract('style-loader', 'css-loader!less-loader'),
|
27 | options: {strictMath: true},
|
28 | },
|
29 | {
|
30 | test: /\.css$/,
|
31 | loader: ExtractTextPlugin.extract('style-loader', 'css-loader'),
|
32 | },
|
33 | { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader?limit=10000?name=fonts/[name].[ext]&minetype=application/font-woff' },
|
34 | { test: /\.(ttf|eot|svg|png)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader?name=fonts/[name].[ext]' },
|
35 | ],
|
36 | },
|
37 | postcss: [ autoprefixer ],
|
38 | plugins: [
|
39 | new webpack.optimize.OccurrenceOrderPlugin(true),
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 | new ExtractTextPlugin('HugeTable.css', {
|
48 | allChunks: true,
|
49 | }),
|
50 | new CopyWebpackPlugin([
|
51 | { from: './src/HugeTableLess.less', to: ''},
|
52 | ]),
|
53 | ],
|
54 | progress: true,
|
55 | colors: true,
|
56 | };
|
57 |
|
58 | module.exports = config;
|