-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
39 lines (36 loc) · 873 Bytes
/
webpack.config.js
File metadata and controls
39 lines (36 loc) · 873 Bytes
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
const webpack = require('webpack');
const path = require('path');
REACT_DIR = path.join(__dirname, 'react')
const babelLoaderQuery = {
cacheDirectory: 'babel_cache',
presets: ['react', 'es2015']
}
module.exports = {
entry: path.join(REACT_DIR, 'app-client.jsx'),
output: {
path: path.join(__dirname, 'public/static'),
filename: 'bundle.js'
},
module: {
loaders: [
{
test: path.join(__dirname, 'react'),
loader: ['babel-loader?' + JSON.stringify(babelLoaderQuery)]
}
]
},
plugins: [
// new webpack.optimize.DedupePlugin(),
// new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false },
mangle: true,
sourcemap: false,
beautify: false,
dead_code: true
})
],
resolve: {
extensions: ['.js', '.jsx']
}
};