forked from rgaidot/simple-webpack-react-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack-prod.config.js
39 lines (36 loc) · 912 Bytes
/
webpack-prod.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
var commonConfig = require('./webpack-common.config.js');
var HtmlWebpackPlugin = require('html-webpack-plugin')
var webpack = require('webpack');
var prodLoaders = [
// javascript/jsx loader - https://www.npmjs.com/package/babel-loader - without the react-hot loader
{
test: /\.jsx?$/,
exclude: /node_modules/,
loaders: ['babel-loader?stage=0&optional=runtime'],
}
]
module.exports = {
entry: [
// our entry file
'./app/main.js'
],
output: {
path: './build',
filename: 'bundle.[hash].js'
},
devtool:'source-map',
devServer: {
// proxy calls to api to our own node server backend
proxy: {
'/api/*': 'http://localhost:5000/'
}
},
module: {
loaders: commonConfig.loaders.concat(prodLoaders)
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({minimize: true}),
commonConfig.indexPagePlugin
],
};