-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.prod.js
43 lines (37 loc) · 1.03 KB
/
webpack.config.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
/**
* @fileOverview Webpack configuration file for production.
*/
'use strict';
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
let config = require('./webpack.config.base');
config.output.filename = 'js/app.[chunkhash:8].js';
config.plugins = [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production'),
}
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'app.vendor',
filename: 'js/app.vendor.[chunkhash:8].js',
minChunks: module => /node_modules/.test(module.resource),
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
},
sourceMap: true,
}),
new ExtractTextPlugin('css/app.[chunkhash:8].css'),
new StyleLintPlugin({
syntax: 'scss',
failOnError: true,
}),
new ManifestPlugin({
fileName: 'manifest.json',
}),
];
module.exports = config;