Some problems that must be introduced are defined in sass, such as functions or mixin, etc.

in sass, a function or mixin is defined and written separately in a file. For example,
@ import, is required to call mixin.scss, but in component development, many components are used, each of which is introduced, which is very troublesome

.

I wonder if there is any way to use it globally without writing @ import

Feb.28,2021

introduce scss file
1 in main.js Add dependency

npm install sass-resources-loader --save-dev

2. Modify build/utils.js

scss: generateLoaders('sass').concat(
      {
        loader: 'sass-resources-loader',
        options: {
          resources: path.resolve(__dirname, '../src/assets/your.scss')
        }
      }
    )

almost missed introducing scss into main.js

Menu