123456789101112131415161718192021222324252627282930313233343536373839404142 |
- // vue.config.js
-
-
- // vue.config.js
- const path = require('path')
- const resolve = dir => path.join(__dirname, dir)
-
-
- module.exports = {
- css: {
- loaderOptions: {
- less: {
- modifyVars: {
- // 直接覆盖变量
- 'blue': '#2CB798',
- },
- },
- },
- },
-
- devServer: {
- proxy: {
- '/api': {
- target: "http://192.168.89.147:8080/",
- // ws: true,
- changeOrigin: true,
- // pathRewrite: {
- // // 路径重写
- // "/api": "" // 这个意思就是以api开头的,定向到哪里, 如果你的后边还有路径的话, 会自动拼接上
- // }
- },
- },
-
-
- },
- lintOnSave: false,
- publicPath: "./",//在vue-cli.3.3版本后 baseUrl被废除了,因此这边要写成 publicPath。 https://cli.vuejs.org/zh/config/#vue-config-js
- runtimeCompiler: true,
- chainWebpack: config => {
- config.resolve.alias.set("@", resolve("src"));
- }
- }
|