text: const webpack = require('webpack')
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const merge = require('webpack-merge')
  const base = require('./webpack.base.conf')
  
  const config = merge(base, {
    plugins: [
      // strip dev-only code in Vue source
      new webpack.DefinePlugin({
        'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
      }),
      // extract vendor chunks for better caching
      new webpack.optimize.CommonsChunkPlugin({
        name: 'vendor',
        minChunks: function (module) {
          // a module is extracted into the vendor chunk if...
          return (
            // it's inside node_modules
            /node_modules/.test(module.context) &&
            // and not a CSS file (due to extract-text-webpack-plugin limitation)
            !/\.css$/.test(module.request)
          )
        }
      }),
      // Minify and optimize the index.html
      new HtmlWebpackPlugin({
        template: 'index.html',
        minify: {
          removeComments: true,
          collapseWhitespace: true,
          removeRedundantAttributes: true,
          useShortDoctype: true,
          removeEmptyAttributes: true,
          removeStyleLinkTypeAttributes: true,
          keepClosingSlash: true,
          minifyJS: true,
          minifyCSS: true,
          minifyURLs: true
        },
        inject: true
      }),
      // extract webpack runtime & manifest to avoid vendor chunk hash changing
      // on every build.
      new webpack.optimize.CommonsChunkPlugin({
        name: 'manifest'
      })
    ]
  })
  
  
  
  module.exports = config
  