-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
49 lines (48 loc) · 1.21 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
var webpack = require('webpack');
var HTMLWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
module.exports = {
devtool: 'source-map',
entry: [
__dirname + '/app/index.js'
],
resolve: {
root: path.resolve('./'),
alias: {
components: path.resolve(__dirname, 'app/components'),
pages: path.resolve(__dirname, 'app/pages')
},
extensions: ['', '.js', '.jsx']
},
output: {
path: __dirname + '/dist',
filename: "index_bundle.js",
publicPath: '/'
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
exclude: /\.js($|\?)/i
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new HTMLWebpackPlugin({
template: __dirname + '/app/index.html',
filename: 'index.html',
inject: 'body'
})
],
module: {
loaders: [
{test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel', presets: ['react', 'es2015'] },
{test: /\.css$/, loaders: ['style-loader', 'css-loader']},
{test: /\.(png|jpg|)$/, loader: 'url-loader?limit=200000'}
]
}
}