12345678910111213141516171819202122232425262728 |
- const {
- defineConfig
- } = require('@vue/cli-service')
- module.exports = defineConfig({
- transpileDependencies: true,
- //基本路径
- publicPath: './', //默认的'/'是绝对路径,如果不确定在根路径,改成相对路径'./'
- // 输出文件目录
- outputDir: 'dist',
- //endOfLine: 'auto',
- lintOnSave: false,
- devServer: {
- port: 8086, // 端口
- open: false, //自动在浏览器中打开
- proxy: {
- '/api': {
- target: 'http://localhost:5239/api',
- changeOrigin: true, //是否跨域,肯定true
- pathRewrite: { //重写请求中的/api为空
- '^/api': ''
- }
- },
- }
- },
- })
|