-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
51 lines (49 loc) · 1.23 KB
/
webpack.config.js
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
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var webpack = require("webpack");
var path = require('path');
var HTMLWebpackPluginConfig = new HtmlWebpackPlugin({
template: __dirname + '/client/index.html',
filename: 'index.html',
inject: 'body'
});
module.exports = {
entry: [
'./client/index.jsx',
'./client/styles.css'
],
output: {
filename: 'bundle.js',
path: __dirname + '/dist'
},
resolve: {
extensions: ['', '.jsx', '.scss', '.js', '.json'],
modulesDirectories: [
'node_modules',
path.resolve(__dirname, './node_modules')
]
},
module: {
loaders: [
{
test: /(\.jsx|\.js)$/,
loaders: ['react-hot', 'babel?presets[]=react,presets[]=es2015'],
exclude: /node_modules/
},
{
test: /(\.scss|\.css)$/,
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap')
}
]
},
plugins: [
HTMLWebpackPluginConfig,
new ExtractTextPlugin("/bundle.css"),
]
}
// new webpack.optimize.UglifyJsPlugin({
// compress: {
// warnings: false
// }
// })
//