forked from daren.hsu/line_push
21 lines
903 B
JavaScript
21 lines
903 B
JavaScript
import dartSass from 'sass';
|
|
export default function setupSass(customVariables) {
|
|
const { sass, scss } = this.options.build.loaders;
|
|
// Use Dart Sass
|
|
sass.implementation = scss.implementation = dartSass;
|
|
// Ensure compatibility with Nuxt < 2.10 (i.e. before https://github.com/nuxt/nuxt.js/pull/6460)
|
|
if (!sass.sassOptions) {
|
|
delete sass.indentedSyntax;
|
|
sass.sassOptions = {
|
|
indentedSyntax: true
|
|
};
|
|
}
|
|
// Custom variables
|
|
if (customVariables && customVariables.length > 0) {
|
|
const sassImports = customVariables.map(path => `@import '${path}'`).join('\n');
|
|
sass.prependData = [sass.prependData, sassImports].join('\n');
|
|
const scssImports = customVariables.map(path => `@import '${path}';`).join('\n');
|
|
scss.prependData = [scss.prependData, scssImports].join('\n');
|
|
}
|
|
}
|
|
//# sourceMappingURL=sass.js.map
|