-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.ui.prod.js
48 lines (41 loc) · 1.24 KB
/
webpack.config.ui.prod.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
'use strict';
var path = require('path');
var assign = require('object-assign');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var webpackTargetElectronRenderer = require('webpack-target-electron-renderer');
var baseConfig = require('./webpack.config.base');
var config = assign(baseConfig, {
entry: './src/ui/app',
output: {
path: path.join(__dirname, 'public', 'build'),
filename: 'bundle.min.js',
publicPath: './',
libraryTarget: 'commonjs2'
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }
}),
new ExtractTextPlugin('app.min.css')
],
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
stage: 0
}
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!cssnext-loader')
}],
postLoaders: [{
loader: 'transform?envify'
}]
}
});
config.target = webpackTargetElectronRenderer(config);
module.exports = config;