-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.example.config.js
41 lines (39 loc) · 1.04 KB
/
webpack.example.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
import webpack from 'webpack';
import pkg from './package.json';
const webpackExample = {
cache: true,
debug: true,
devtool: 'eval-source-map',
output: {
filename: 'build.min.js'
},
module: {
loaders: [
{
loader: 'babel-loader',
test: /\.(js|jsx)$/,
exclude: /(node_modules|bower_components)/,
query: {
plugins: ['transform-runtime'],
presets: ['es2015', 'stage-1', 'react']
}
}, {
test: /\.json$/,
loader: 'json'
}
]
},
resolve: {
extensions: ['', '.js', '.jsx', '.json']
},
plugins: [new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('"production"')
}
})/*,
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin()*/
]
};
export default webpackExample;