1 | const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
2 |
|
3 | module.exports = {
|
4 | debug: true,
|
5 | devtool: 'source-map',
|
6 | entry: './example/demo.js',
|
7 | output: {
|
8 | path: './example/public',
|
9 | filename: 'bundle.js',
|
10 | publicPath: '',
|
11 | },
|
12 | module: {
|
13 | loaders: [
|
14 | {
|
15 | test: /\.js$/,
|
16 | exclude: /node_modules/,
|
17 | loader: 'babel-loader?presets[]=es2015&presets[]=react&presets[]=stage-0',
|
18 | },
|
19 | {
|
20 | test: /\.less$/,
|
21 | loader: ExtractTextPlugin.extract('style-loader', 'css-loader!less-loader'),
|
22 | },
|
23 | {
|
24 | test: /\.css$/,
|
25 | loader: ExtractTextPlugin.extract('style-loader', 'css-loader'),
|
26 | },
|
27 | { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader?limit=10000&minetype=application/font-woff' },
|
28 | { test: /\.(ttf|eot|svg|png)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' },
|
29 | ],
|
30 | },
|
31 | plugins: [
|
32 | new ExtractTextPlugin('bundle.css'),
|
33 | ],
|
34 | };
|