1 | var webpack = require('webpack')
|
2 | var merge = require('webpack-merge')
|
3 | var baseConfig = require('./webpack.base.conf')
|
4 | var cssLoaders = require('./css-loaders')
|
5 | var ExtractTextPlugin = require('extract-text-webpack-plugin')
|
6 | var HtmlWebpackPlugin = require('html-webpack-plugin')
|
7 |
|
8 |
|
9 |
|
10 | var SOURCE_MAP = true
|
11 |
|
12 | module.exports = merge(baseConfig, {
|
13 | stats: {
|
14 | children: false
|
15 | },
|
16 | devtool: SOURCE_MAP ? '#source-map' : false,
|
17 | output: {
|
18 |
|
19 |
|
20 | filename: '[name].js',
|
21 | chunkFilename: '[id].[chunkhash].js'
|
22 | },
|
23 | vue: {
|
24 | loaders: cssLoaders({
|
25 | sourceMap: SOURCE_MAP,
|
26 | extract: true
|
27 | })
|
28 | },
|
29 | plugins: [
|
30 |
|
31 | new webpack.DefinePlugin({
|
32 | 'process.env': {
|
33 | NODE_ENV: '"production"'
|
34 | }
|
35 | }),
|
36 | new webpack.optimize.UglifyJsPlugin({
|
37 | compress: {
|
38 | warnings: false
|
39 | }
|
40 | }),
|
41 | new webpack.optimize.OccurenceOrderPlugin(),
|
42 |
|
43 | new ExtractTextPlugin('[name].css'),
|
44 |
|
45 |
|
46 |
|
47 | new HtmlWebpackPlugin({
|
48 | filename: '../index.html',
|
49 | template: 'index.html',
|
50 | inject: true,
|
51 | minify: {
|
52 | removeComments: true,
|
53 | collapseWhitespace: true,
|
54 | removeAttributeQuotes: true
|
55 |
|
56 |
|
57 | }
|
58 | })
|
59 | ]
|
60 | })
|