Skip to content

Commit 3c1c1e6

Browse files
committed
fix: don't override sassLoader data
1 parent f8f0392 commit 3c1c1e6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/module.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ module.exports = function (moduleOptions) {
3434

3535
// Customize sass-loader options
3636
Object.assign(this.options.build.loaders.scss, sassLoaderOptions)
37-
sassLoaderOptions.data = options.customVariables.map(path => `@import '${path}'`).join('\n')
3837
Object.assign(this.options.build.loaders.sass, sassLoaderOptions)
3938

39+
// Custom variables
40+
const sassLoaderData = this.options.build.loaders.sass.data
41+
if (options.customVariables.length > 0 && typeof sassLoaderData !== 'function') {
42+
const imports = options.customVariables.map(path => `@import '${path}'`).join('\n')
43+
this.options.build.loaders.sass.data = sassLoaderData ? sassLoaderData.concat('\n', imports) : imports
44+
}
45+
4046
// Add styles
4147
if (options.treeShake) {
4248
this.options.css.push('vuetify/src/styles/main.sass')

0 commit comments

Comments
 (0)