-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.web.production.config.js
51 lines (43 loc) · 1.12 KB
/
webpack.web.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
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
/**
* This is the Webpack configuration file for production.
*/
module.exports = {
entry: "./src/main",
output: {
path: __dirname + "/build/",
filename: "app.js"
},
plugins: [
new ExtractTextPlugin({ filename: 'style.css', allChunks: true }),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production'),
'web': true
}
})
],
module: {
loaders: [
{ test: /\.jsx?$/, exclude: /node_modules/, loader: "babel-loader" },
{ test: /\.css$/, loader: ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', loader: 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader'} ) },
{ test: /\.json?$/, loaders: ["json-loader"] },
]
},
resolve: {
extensions: ['', '.js', '.jsx', '.css'],
},
postcss: [
require('autoprefixer'),
require('postcss-nested')
],
node: {
fs: "empty",
},
externals: [
{
electron: "var x = null"
}
]
}