VUE3.0 打包在tomcat中运行

在这里插入图片描述
vue 下面新增 vue.config.js文件
内容:


module.exports = {
    baseUrl: process.env.NODE_ENV === 'production' ? '/videocontroller-web/' : '/',
    // outputDir: 在npm run build时 生成文件的目录 type:string, default:'dist'
    outputDir: 'videocontroller-web',
    // pages:{ type:Object,Default:undfind } 
    devServer: {
        port: 8888, // 端口号
        host: 'localhost',
        https: false, // https:{type:Boolean}
        open: true, //配置自动启动浏览器
        // proxy: 'http://localhost:4000' // 配置跨域处理,只有一个代理
        proxy: {
            '/api': {
                target: 'http://127.0.0.1:60180/',
                changeOrigin: true,
                pathRewrite: {
                    '^/api': ''
                }
            },
            '/foo': {
                target: '<other_url>'
            }
        },  // 配置多个代理
    }
}

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_25430563/article/details/88385966
今日推荐