You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
const { defineConfig } = require("@vue/cli-service");
|
|
|
|
|
|
|
|
|
|
module.exports = defineConfig({
|
|
|
|
|
//打包清除console
|
|
|
|
|
// chainWebpack(config) {
|
|
|
|
|
// config.optimization.minimizer("terser").tap((args) => {
|
|
|
|
|
// args[0].terserOptions.compress.drop_console = true;
|
|
|
|
|
// return args;
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
productionSourceMap: false, // 生产环境是否要生成 sourceMap
|
|
|
|
|
publicPath: process.env.PUBLIC_PATH ? process.env.PUBLIC_PATH : "./", // 部署应用包时的基本 URL
|
|
|
|
|
// assetsPublicPath: process.env.NODE_ENV === "production" ? "" : "/",
|
|
|
|
|
outputDir: "dist", // 打包时输出的文件目录
|
|
|
|
|
assetsDir: "static", // 放置静态文件夹目录
|
|
|
|
|
transpileDependencies: true,
|
|
|
|
|
lintOnSave: false,
|
|
|
|
|
devServer: {
|
|
|
|
|
port: 8093, // 端口号的配置
|
|
|
|
|
proxy: {
|
|
|
|
|
"/cac-api": {
|
|
|
|
|
//表示拦截以/api开头的请求路径
|
|
|
|
|
//target: "http://192.168.1.190:88", //200服务器
|
|
|
|
|
target: "http://dev.xinyingpower.com:40080/", //dell服务器
|
|
|
|
|
changOrigin: true, //是否开启跨域
|
|
|
|
|
pathRewrite: {
|
|
|
|
|
"^/api": "/cac-api", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|