vue项目用webpack全局引用某个scss

首先引用scss
一、目录 package.json

"dependencies": {
    "vue": "^2.5.2",
    "vue-router": "^3.0.1",
    "node-sass": "^4.14.1",
 },
"devDependencies": {
    "sass-loader": "^7.3.1",
    "sass-resources-loader": "^2.2.3",
}

目录 build/utils.js

	sass: generateLoaders('sass', { indentedSyntax: true }),
	scss:generateLoaders('sass').concat(
        {
          loader: 'sass-resources-loader',
          options: {
            resources: path.resolve(__dirname, '../src/styles/index.scss')
          }
        }
    ),

你可能感兴趣的:(vue,scss,vue.js)