|
@@ -29,13 +29,28 @@ export default defineConfig({
|
|
|
host: '127.0.0.1',
|
|
|
port: 8080, // 端口
|
|
|
proxy: {
|
|
|
- '/api': { // 请求接口中要替换的标识
|
|
|
+ '/pp': { // 请求接口中要替换的标识
|
|
|
target: 'http://localhost:9080', // 代理地址
|
|
|
changeOrigin: true, // 是否允许跨域
|
|
|
secure: true,
|
|
|
- rewrite: (path) => path.replace(/^\/api/, '/api') // api标志替换为''
|
|
|
+ rewrite: (path) => path.replace(/^\/pp/, '/pp') // api标志替换为''
|
|
|
},
|
|
|
}
|
|
|
+ },
|
|
|
+ base: './',
|
|
|
+ build: {
|
|
|
+ chunkSizeWarningLimit: 1000,
|
|
|
+ outDir: "dist",
|
|
|
+ assetsDir: "assets", //指定静态资源存放路径
|
|
|
+ // assetsPublicPath:'',
|
|
|
+ sourcemap: true, //是否构建source map 文件
|
|
|
+ terserOptions: {
|
|
|
+ // 生产环境移除console
|
|
|
+ compress: {
|
|
|
+ drop_console: true,
|
|
|
+ drop_debugger: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
}
|
|
|
|
|
|
})
|