|
1 |
| -const ExtractTextPlugin = require("extract-text-webpack-plugin"); |
| 1 | +const ExtractTextPlugin = require('extract-text-webpack-plugin'); |
2 | 2 |
|
3 | 3 | module.exports = {
|
4 |
| - devtool: 'source-map', |
5 |
| - entry: './src/index.js', |
6 |
| - output: { |
7 |
| - path: __dirname, |
8 |
| - filename: 'bundle.js' |
9 |
| - }, |
10 |
| - module: { |
11 |
| - rules: [ |
12 |
| - { |
13 |
| - test: /\.jsx?$/, |
14 |
| - exclude: /(node_modules|bower_components)/, |
15 |
| - loader: 'babel-loader', |
16 |
| - query: { |
17 |
| - presets: ['env', 'stage-2', 'react', 'minify'] |
18 |
| - } |
19 |
| - }, |
20 |
| - { |
21 |
| - test: /\.scss$/, |
22 |
| - exclude: /(node_modules|bower_components)/, |
23 |
| - use: ExtractTextPlugin.extract({ |
24 |
| - use: [{ |
25 |
| - loader: 'css-loader', |
26 |
| - options: {sourceMap: true} |
27 |
| - }, { |
28 |
| - loader: 'postcss-loader', |
29 |
| - options: { |
30 |
| - sourceMap: true, |
31 |
| - plugins: () => ([ |
32 |
| - require('autoprefixer')({ |
33 |
| - browsers: ['last 2 versions', 'ie > 8'], |
34 |
| - }), |
35 |
| - ]) |
36 |
| - } |
37 |
| - }, { |
38 |
| - loader: 'sass-loader', |
39 |
| - options: {sourceMap: true} |
40 |
| - }] |
41 |
| - }) |
42 |
| - } |
43 |
| - ] |
44 |
| - }, |
45 |
| - plugins: [ |
46 |
| - new ExtractTextPlugin("bundle.css", {allChunks: true}) |
47 |
| - ] |
| 4 | + devtool: 'source-map', |
| 5 | + entry: './src/index.js', |
| 6 | + output: { |
| 7 | + path: __dirname, |
| 8 | + filename: 'bundle.js', |
| 9 | + }, |
| 10 | + module: { |
| 11 | + rules: [ |
| 12 | + { |
| 13 | + test: /\.jsx?$/, |
| 14 | + exclude: /(node_modules|bower_components)/, |
| 15 | + loader: 'babel-loader', |
| 16 | + query: { |
| 17 | + presets: ['env', 'stage-2', 'react', 'minify'], |
| 18 | + }, |
| 19 | + }, |
| 20 | + { |
| 21 | + test: /\.scss$/, |
| 22 | + exclude: /(node_modules|bower_components)/, |
| 23 | + use: ExtractTextPlugin.extract({ |
| 24 | + use: [ |
| 25 | + { |
| 26 | + loader: 'css-loader', |
| 27 | + options: {sourceMap: true}, |
| 28 | + }, { |
| 29 | + loader: 'postcss-loader', |
| 30 | + options: { |
| 31 | + sourceMap: true, |
| 32 | + plugins: () => ([ |
| 33 | + require('autoprefixer')({ |
| 34 | + browsers: ['last 2 versions', 'ie > 8'], |
| 35 | + }), |
| 36 | + ]), |
| 37 | + }, |
| 38 | + }, { |
| 39 | + loader: 'sass-loader', |
| 40 | + options: {sourceMap: true}, |
| 41 | + }], |
| 42 | + }), |
| 43 | + }, |
| 44 | + ], |
| 45 | + }, |
| 46 | + plugins: [ |
| 47 | + new ExtractTextPlugin({filename: 'bundle.css', allChunks: true}), |
| 48 | + ], |
48 | 49 | };
|
0 commit comments