-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.production.config.js
44 lines (42 loc) · 1.16 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
var BUNDLE_NAME = "app";
var Webpack = require('webpack');
module.exports = {
entry: "./demo/" + BUNDLE_NAME + ".jsx",
output: {
path: './demo/build',
publicPath: '.demo/build',
filename: BUNDLE_NAME + '.js'
},
module: {
loaders: [
{
test: /\.(jsx|es|js)$/,
loader: 'babel-loader',
query: {
presets: ['react', 'es2015', 'stage-0', 'stage-1']
},
},
{test: /\.css$/, loaders: ['style-loader', 'css-loader']},
{test: /\.scss$/, loaders: ['style-loader', 'css-loader', 'sass-loader?sourceMap']},
{test: /\.png$/, loaders: ['url-loader?limit=150000']},
{test: /\.jpg$/, loaders: ['url-loader?limit=150000']},
{test: /\.ttf$/, loader: 'url-loader?limit=150000'},
{test: /\.json$/, loader: 'json-loader'},
{test: /\.json5$/, loader: 'json5-loader'}
]
},
resolve: {
extensions: ['', '.js', '.es', '.css', '.scss', '.png', '.jpg', '.ttf', '.json', '.json5']
},
plugins: [
new Webpack.NoErrorsPlugin(),
new Webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
})
],
node: {
fs: 'empty'
}
};