forked from Midburn/Volunteers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.config.js
61 lines (60 loc) · 1.41 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const {resolve} = require('path');
const webpack = require('webpack');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const BabiliPlugin = require('babili-webpack-plugin');
module.exports = {
entry: [
'./src/index.js'
],
output: {
filename: 'bundle.js',
path: resolve(__dirname, 'public'),
publicPath: 'http://localhost:9090/'
},
externals: {
react: 'React',
lodash: '_',
mobx: 'mobx',
moment: 'moment',
axios: 'axios',
'react-dom': 'ReactDOM',
'react-bootstrap': 'ReactBootstrap',
'react-bootstrap-typeahead': 'ReactBootstrapTypeahead'
},
module: {
loaders: [
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{
test: /\.scss$/,
use: [{
loader: "style-loader" // creates style nodes from JS strings
}, {
loader: "css-loader" // translates CSS into CommonJS
}, {
loader: "sass-loader" // compiles Sass to CSS
}]
},
{
test: /\.(png|woff|woff2|otf|ttf|svg|eot)$/,
use: ['url-loader']
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
}),
// new BundleAnalyzerPlugin(),
new BabiliPlugin()
]
};