-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.config.babel.js
More file actions
60 lines (59 loc) · 1.65 KB
/
webpack.dev.config.babel.js
File metadata and controls
60 lines (59 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import path from 'path';
import webpack from 'webpack';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import combineLoaders from 'webpack-combine-loaders';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import autoprefixer from 'autoprefixer';
import CompressionPlugin from 'compression-webpack-plugin';
module.exports = {
devtool: 'eval',
entry: {
app: './scripts/index.js',
vendor: [
'react',
'react-dom'
]
},
output: {
path: path.join(__dirname, 'dist'),
publicPath: './dist/',
filename: 'bundle.js',
chunkFilename: "[name].chunk.js"
},
module: {
loaders: [{
test: /\.js/,
loader: 'babel',
exclude: /node_modules/
}, {
test: /\.scss$/,
loader: ExtractTextPlugin.extract(
'style-loader',
combineLoaders([{
loader: 'css-loader',
query: {
modules: true,
localIdentName: '[name]__[local]__[hash:base64:5]'
}
}, {
loader: 'postcss-loader'
}, {
loader: 'sass-loader'
}])
)
}, {
test: /\.(png|jpg|svg)$/,
loaders: ['url', 'image-webpack']
}]
},
postcss: [autoprefixer({
browsers: ['last 2 versions']
})],
plugins: [
new ExtractTextPlugin("site.css"),
new webpack.optimize.CommonsChunkPlugin("vendor", "vendor.bundle.js")
],
externals: {
//'react': 'React'
},
};