123456789101112131415161718192021222324252627282930313233343536373839 |
- const {
- defineConfig
- } = require('@vue/cli-service')
- const {
- VantResolver
- } = require('unplugin-vue-components/resolvers');
- const ComponentsPlugin = require('unplugin-vue-components/webpack');
- module.exports = defineConfig({
- transpileDependencies: true,
- configureWebpack: {
- plugins: [
- ComponentsPlugin({
- resolvers: [VantResolver()],
- }),
- ],
- },
- devServer: {
- // https: true,
- port: "8088", //代理端口
- open: false, //项目启动时是否自动打开浏览器,我这里设置为false,不打开,true表示打开
- headers: {
- 'Access-Control-Allow-Origin': '*',
- },
- proxy: {
- // https://cn.vitejs.dev/config/#server-proxy
- '/test-api': {
- target: 'http://139.9.102.170:20010/',
- changeOrigin: true,
- rewrite: (p) => p.replace(/^\/test-api/, '')
- },
- '/prod-api': {
- target: 'http://175.178.26.5',
- changeOrigin: true,
- rewrite: (p) => p.replace(/^\/prod-api/, '')
- }
- }
- },
- })
|