1 |
|
2 | var _ = require('lodash');
|
3 | var path = require('path');
|
4 | var webpack = require('webpack');
|
5 | var baseConfig = require('./webpack.config.base');
|
6 |
|
7 | module.exports = _.assign({}, baseConfig, {
|
8 | devtool: 'source-map',
|
9 | entry: {
|
10 | app: baseConfig.entry.app,
|
11 | vendor: baseConfig.entry.vendor
|
12 | },
|
13 | output: {
|
14 | path: path.join(__dirname, 'dist/web'),
|
15 | filename: '[name].js',
|
16 | publicPath: '/'
|
17 | },
|
18 | plugins: [
|
19 | new webpack.DefinePlugin({
|
20 | 'process.env': {
|
21 |
|
22 | NODE_ENV: JSON.stringify('production')
|
23 | }
|
24 | }),
|
25 | new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
|
26 | new webpack.optimize.OccurrenceOrderPlugin(),
|
27 | new webpack.optimize.DedupePlugin(),
|
28 | new webpack.optimize.UglifyJsPlugin({
|
29 | compress: {
|
30 | warnings: false
|
31 | },
|
32 | mangle: false
|
33 | })
|
34 | ]
|
35 | });
|