zoukankan      html  css  js  c++  java
  • vue.config.js配置

    // const path = require('path')
    
    module.exports = {
        runtimeCompiler: true,
        devServer: {
            proxy: {
                '/mock': {
                    target: 'https://easy-mock.com/mock/example',
                    // ws: true,
                    changeOrigin: true,
                    pathRewrite: {//重写路径
                        "^/mock": ''
                    }
                },
                '/api': {
                  target: 'http://~',//测试
                  // ws: true,
                  changeOrigin: true,
                  pathRewrite: {//重写路径
                      "^/api": ''
                  }
                }
            }
        },
        pluginOptions: {
          'style-resources-loader': {
            patterns: [
              // main.js里全局引入css配置
              // path.resolve(__dirname, './src/styles/*.scss')
            ],
            preProcessor: 'scss'
          }
        },
        css: {
          // 向所有 Sass 样式传入共享的全局变量:
          loaderOptions: {
            // 给 sass-loader 传递选项
            sass: {
              // @/ 是 src/ 的别名
              // 所以这里假设你有 `src/variables.scss` 这个文件
              data: `@import "~@/styles/variables.scss";`
            }
          }
        }
    }
    
  • 相关阅读:
    导弹拦截版
    [USACO1.5]数字三角形 Number Triangles
    FBI树
    修复公路
    台阶问题
    阶乘问题
    连续自然数和
    又是毕业季I
    生活大爆炸版石头剪刀布
    曹冲养猪
  • 原文地址:https://www.cnblogs.com/knuzy/p/11374480.html
Copyright © 2011-2022 走看看