Skip to content

Commit 98e3fc7

Browse files
committed
extract text plugin config
1 parent b062d9c commit 98e3fc7

File tree

2 files changed

+47
-46
lines changed

2 files changed

+47
-46
lines changed

bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webpack.config.js

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,49 @@
1-
const ExtractTextPlugin = require("extract-text-webpack-plugin");
1+
const ExtractTextPlugin = require('extract-text-webpack-plugin');
22

33
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+
],
4849
};

0 commit comments

Comments
 (0)