-
Notifications
You must be signed in to change notification settings - Fork 7
/
webpack.config.production.js
55 lines (52 loc) · 1.2 KB
/
webpack.config.production.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
52
53
54
55
/**
* mill - webpack.config.production.js
*
* Authors:
* xeodou <[email protected]>
*/
'use strict';
/**
* Module dependencies.
*/
const webpack = require('webpack');
const path = require('path');
module.exports = {
devtool: 'source-map',
entry: {
app: './src/app.jsx',
vendor: ["history", "qs", "react", "react-dom","react-router","whatwg-fetch"]
},
output: {
filename: 'mill.min.js',
path: path.join(__dirname, '.'),
publicPath: './',
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
module: {
loaders: [{
test: /\.js|jsx$/,
exclude: /(node_modules\/(?!qs)|bower_components)/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-0'],
},
}],
},
plugins: [
new webpack.IgnorePlugin(/themes/),
new webpack.NoErrorsPlugin(),
new webpack.optimize.CommonsChunkPlugin("vendor", "vendor.bundle.js"),
new webpack.optimize.UglifyJsPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
},
__DEVTOOLS__: false,
}),
new webpack.ProvidePlugin({
fetch: 'imports?this=>global!exports?global.fetch!whatwg-fetch',
}),
],
};