UNPKG

1.8 kBJavaScriptView Raw
1const ExtractTextPlugin = require('extract-text-webpack-plugin');
2const webpack = require('webpack');
3const autoprefixer = require('autoprefixer');
4const CopyWebpackPlugin = require('copy-webpack-plugin');
5
6const config = {
7 debug: false,
8 entry: [
9 // __dirname + '/src/index.js',
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 // test: /\.js$/,
21 // exclude: /node_modules/,
22 // loader: 'babel-loader?presets[]=es2015&presets[]=react&presets[]=stage-0',
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 // Merge all duplicate modules
41 // new webpack.optimize.DedupePlugin(),
42 // new webpack.optimize.UglifyJsPlugin({ // Optimize the JavaScript...
43 // compress: {
44 // warnings: false, // ...but do not show warnings in the console (there is a lot of them)
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
58module.exports = config;