阅读 63

nuxt vue添加全局scss 变量

安装插件sass-resources-loader

https://www.npmjs.com/package/sass-resources-loader


build: {
    extend (config, { isDev, isClient }) {
        config.module.rules.push({
        test: /\.scss$/i,
        loader: 'sass-resources-loader',
        options: {
          // Provide path to the file with resources
          resources: './assets/css/resources.scss',
        }
      }) 
    }
    
}
复制代码

确保相关依赖安装node-sass sass-loader scss-loader

也可以通过以下方法添加

www.webpackjs.com/loaders/sas…