const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const webpack = require('webpack');
const path = require('path');

module.exports = merge(common, {
    devtool: 'source-map',
    devServer: {
        hot: true,
        historyApiFallback: true,
        overlay: true,
        open: false,
        host: "0.0.0.0",
        port: 9002,
        disableHostCheck: true,
        proxy: {
            '/eIBS/service/*': {
                target:'http://127.0.0.1:8091/',       //测试环境02
                changeOrigin: true,
            },
            '/psbcfront/*':{
                target:'http://127.0.0.1:8091/',           //测试环境02
                changeOrigin: true,
            },
        },
    },
    plugins: [
        new webpack.NamedModulesPlugin(),
        new webpack.HotModuleReplacementPlugin(),
        new webpack.DefinePlugin({
            'process.env.NODE_ENV': JSON.stringify('development')
        }),
    ]

});
console.log("process.env.NODE_ENV 的值是(webpack.dev.js)：" + process.env.NODE_ENV)
