const CompressionPlugin = require("compression-webpack-plugin");
module.exports = {
    devServer: {
        // 关闭esline
        overlay: {
            warnings: false,
            errors: false,
        },
        proxy: {
            '/labsl': {
                // target: 'http://39.102.40.239:8080',
                // target: 'http://192.168.64.17:28888',
                target:'http://192.168.64.14:28888',
                changeOrigin: true,
                secure: false,
            },
            '/meiku': {
                // target: 'http://39.102.40.239:8080',
                target:'http://192.168.64.14:28888',
                // target: 'http://192.168.64.17:28888',
                changeOrigin: true,
                secure: false,
            },
            '/datacenter': {
                // target: 'http://39.102.40.239:8080',
                target:'http://192.168.64.14:28888',
                // target: 'http://192.168.64.17:28888',
                changeOrigin: true,
                secure: false,
            },
            '/equip-component': {
                // target: 'http://39.102.40.239:8080',
                // target: 'http://192.168.64.17:28888',
                target:'http://192.168.64.14:28888',
                changeOrigin: true,
                secure: false,
            },
            // 图片服务器
            '/image-service': {
                target: 'http://39.102.40.239',
                changeOrigin: true,
                secure: false,
            },
        },
    },
    lintOnSave: false,
    publicPath: '/persagyTopo',
    // 打包名称
    outputDir: 'persagyTopo',
    // 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录
    assetsDir: 'static',

    // 配置webpack
    // configureWebpack: (config) => {
    //     // 生成环境,删除console.log和debugger
    //     // if (process.env.VUE_Plan_RealEnv === "production") {
    //     //     config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true; //删除console
    //     //     config.optimization.minimizer[0].options.terserOptions.compress.drop_debugger = true; //删除 debugger
    //     //     config.optimization.minimizer[0].options.terserOptions.compress.pure_funcs = ["console.log"]; //删除
    //     // }
    //     const plugins = [
    //         // 压缩代码
    //         new CompressionPlugin({
    //             test: /\.js$|\.html$|\.css$/, // 匹配文件名
    //             threshold: 10240, // 对超过10k的数据压缩
    //             deleteOriginalAssets: true, // false 不删除源文件 true 删除源文件
    //         }),
    //     ];
    //     // 生产环境打包分析体积 命令 npm run  build --report 或者 yarn build --report
    //     // if (process.env.NODE_ENV === "production" && (process.env.npm_config_report || process.env.npm_config_argv.indexOf("--report") !== -1)) {
    //     //     plugins.push(new BundleAnalyzerPlugin());
    //     // }
    //     return {
    //         plugins,
    //     };
    // },
    // chainWebpack:config =>{
    //     config.module.rule('svg-sprite')
    //     .use('svgo-loader')
    //     .loader('svgo-loader')
    // }
}