const {defineConfig} = require('@vue/cli-service') module.exports = defineConfig({ transpileDependencies: true, // chainWebpack: (config) => { // // config.resolve.alias.set("@$", resolve("src")).set("@views", resolve("src/views")); // }, // lintOnSave: false, css: { loaderOptions: { less: { // 若 less-loader 版本小于 6.0,请移除 lessOptions 这一级,直接配置选项。 modifyVars: { // 或者可以通过 less 文件覆盖(文件路径为绝对路径) hack: `true; @import "./src/assets/theme.less";`, }, }, }, }, devServer: { client: { overlay: false }, hot: true, //支持热更新 port: 8080, host: "0.0.0.0", proxy: { '/api': { target: 'https://api.ruanjian168.cc', //后期可以改 changeOrigin: true, logLevel: 'debug', pathRewrite: { '^/api': '/api' } } } //contentBase:path.resolve(__dirname,'static') //指定(额外的)静态文件目录, // 如果使用 CopyWebpackPlugin ,设置为false // eslint-disable-next-line no-unused-vars }, configureWebpack: { optimization: { splitChunks: { cacheGroups: { app: { chunks: "all", name: "main", test: /[\\/]src[\\/](.*)[\\/]/, }, vendor: { test: /[\\/]node_modules[\\/][\\/]/, name: "vendor", chunks: "all", }, }, }, }, }, publicPath: "./", outputDir: "dist", assetsDir: "assets", runtimeCompiler: true, })