Skip to content

Commit 1709f2b

Browse files
committed
fix: always setup sass loader options
To be able to use `sass` even when treeShaking disabled (in development mode especially)
1 parent c885469 commit 1709f2b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/module.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ const defaults = {
99
treeShake: process.env.NODE_ENV === 'production'
1010
}
1111

12+
// See https://github.com/vuetifyjs/vuetify/releases/tag/v2.0.0-alpha.12
13+
const sassLoaderOptions = {
14+
implementation: require('sass'),
15+
fiber: require('fibers')
16+
}
17+
1218
module.exports = function (moduleOptions) {
1319
this.nuxt.hook('build:before', () => {
1420
const options = merge.all([
@@ -25,18 +31,12 @@ module.exports = function (moduleOptions) {
2531
}
2632
}
2733

34+
// Customize sass-loader options
35+
Object.assign(this.options.build.loaders.sass, sassLoaderOptions)
36+
Object.assign(this.options.build.loaders.scss, sassLoaderOptions)
37+
2838
// Add styles
2939
if (options.treeShake) {
30-
// See https://github.com/vuetifyjs/vuetify/releases/tag/v2.0.0-alpha.12
31-
const sassLoaderOptions = {
32-
implementation: require('sass'),
33-
fiber: require('fibers')
34-
}
35-
36-
// Customize sass-loader options
37-
Object.assign(this.options.build.loaders.sass, sassLoaderOptions)
38-
Object.assign(this.options.build.loaders.scss, sassLoaderOptions)
39-
4040
this.options.css.push('vuetify/src/styles/main.sass')
4141
} else {
4242
this.options.css.push('vuetify/dist/vuetify.css')

0 commit comments

Comments
 (0)