text: const webpack = require('webpack');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const ExtractTextPlugin = require('extract-text-webpack-plugin');
  const CopyWebpackPlugin = require('copy-webpack-plugin');
  const merge = require('webpack-merge');
  const webpackBaseConfig = require('./webpack.base.config.js');
  const fs = require('fs');
  const package = require('../package.json');
  const path = require('path');
  fs.open('./build/env.js', 'w', function(err, fd) {
      const buf = 'export default "development";';
      fs.write(fd, buf, 0, buf.length, 0, function(err, written, buffer) {});
  });
  
  module.exports = merge(webpackBaseConfig, {
      devtool: '#source-map',
      output: {
          publicPath: '/dist/',
          filename: '[name].js',
          chunkFilename: '[name]-[chunkhash].js'
      },
      devServer: { //消炎 'http://192.168.15.22:8080' 孙运超 'http://192.168.17.27:80' 张瑞 'http://192.168.15.169:8080' 胡 'http://192.168.14.51:8080'
          port: 8056,
          host: '192.168.18.146',
          proxy: {
              "/oa": {
                  target: "http://192.168.15.169:8080",
                  changeOrigin: true
  
              }
          }
      },
      plugins: [
          new webpack.DefinePlugin({
              'process.env': {
                  NODE_ENV: '"development"'
              }
          }),
          new ExtractTextPlugin({
              filename: '[name].css',
              allChunks: true
          }),
          new webpack.NamedModulesPlugin(),
          new webpack.NamedChunksPlugin(),
          new webpack.optimize.CommonsChunkPlugin({
              name: ['vender-exten', 'vender-base'],
              minChunks: Infinity
          }),
          new HtmlWebpackPlugin({
              title: '天马人事管理系统',
              filename: '../index.html',
              template: './src/template/index.ejs',
              inject: false
          }),
          new CopyWebpackPlugin([
              {
                  from: 'src/views/main-components/theme-switch/theme'
              },
          ])
      ]
  });
  