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: {
		port: "8088", //代理端口
		open: false, //项目启动时是否自动打开浏览器，我这里设置为false,不打开，true表示打开
		headers: {
			'Access-Control-Allow-Origin': '*',
		},
		proxy: {
			// https://cn.vitejs.dev/config/#server-proxy
			'/test-api': {
				target: 'http://36.134.91.96:9898',
				changeOrigin: true,
				rewrite: (p) => p.replace(/^\/dev-api/, '')
			}
		}
	},
})



