-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.prod.js
57 lines (55 loc) · 1.46 KB
/
webpack.config.prod.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
56
57
const webpack = require('webpack'),
path = require('path'),
HtmlWebpackPlugin = require('html-webpack-plugin'),
TransferWebpackPlugin = require('transfer-webpack-plugin'),
es3ifyPlugin = require('es3ify-webpack-plugin');
module.exports = {
entry: {
index: './src/index'
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js'
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}, {
test: /\.css$/,
loader: 'style-loader!css-loader'
}]
},
plugins: [
new es3ifyPlugin(),
new HtmlWebpackPlugin({
template: path.join(__dirname, 'src/index.html'),
filename: 'index.html',
inject: true
}),
new TransferWebpackPlugin([
{ from: 'services/polyfill', to: '/js' }
], path.join(__dirname, 'src')),
new webpack.optimize.UglifyJsPlugin({
compress: {
properties: false,
warnings: false
},
output: {
beautify: true,
quote_keys: true
},
mangle: {
screw_ie8: false
},
sourceMap: false
})
],
resolve: {
alias: {
react: "anujs/dist/ReactIE.js",
"react-dom": "anujs/dist/ReactIE.js"
}
}
}