-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.production.config.js
83 lines (70 loc) · 1.36 KB
/
webpack.production.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
var webpack = require('webpack'),
path = require('path'),
ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: [
'./app/app.jsx'
],
output: {
publicPath: '/public',
path: path.join(__dirname, 'public'),
filename: 'bundle.js'
},
resolveLoader: {
moduleDirectories: [ 'node_modules' ]
},
resolve: {
extensions: [ '', '.js', '.jsx' ],
modulesDirectories: [ 'node_modules' ]
},
module: {
loaders: [
{
test: /\.json$/,
loader: 'json-loader'
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
loaders: [ 'jsx-loader' ]
},
{
test: /\.(png|jpg|jpeg|gif|svg)$/,
loader: 'url-loader?limit=10000'
},
{
test: /\.(woff|woff2)$/,
loader: 'url-loader?limit=100000'
},
{
test: /\.(ttf|eot)$/,
loader: 'file-loader'
},
{
test: /\.html$/,
loader: 'html-loader'
},
{
test: /\.css$/,
loader: 'css-loader'
},
{
test: /\.(scss|sass)$/,
loader: ExtractTextPlugin.extract(
'css-loader!sass-loader'
)
}
]
},
plugins: [
// This cuts down React's lib size on production.
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
}
}),
new ExtractTextPlugin('styles.css'),
new webpack.IgnorePlugin(/vertx/),
new webpack.optimize.UglifyJsPlugin({ minimize: true })
]
};