const { defineConfig } = require('@vue/cli-service'); module.exports = defineConfig({ devServer: { // client: { // overlay: false, // 重点:新版写法 // }, historyApiFallback: true, }, transpileDependencies: true, publicPath: './', // 必须是相对路径,否则打包后图片路径会出错 css: { loaderOptions: { postcss: { postcssOptions: { plugins: [ ] } }, less: { additionalData: `@import "@/static/css/app.less";` // 注入全局变量文件 } } } });