Skip to content

Commit ebdb142

Browse files
authored
fix: fix sassOptions merging for scss syntax in sass-loader v8 (vuejs#4631)
fixes vuejs#4630
1 parent 8869a01 commit ebdb142

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

packages/@vue/cli-service/__tests__/css.spec.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,10 @@ test('css.loaderOptions', () => {
307307
css: {
308308
loaderOptions: {
309309
sass: {
310-
prependData
310+
prependData,
311+
sassOptions: {
312+
includePaths: ['./src/styles']
313+
}
311314
}
312315
}
313316
}
@@ -316,12 +319,17 @@ test('css.loaderOptions', () => {
316319

317320
expect(findOptions(config, 'scss', 'sass')).toMatchObject({
318321
prependData,
319-
sourceMap: false
322+
sourceMap: false,
323+
sassOptions: {
324+
includePaths: ['./src/styles']
325+
}
320326
})
327+
expect(findOptions(config, 'scss', 'sass').sassOptions).not.toHaveProperty('indentedSyntax')
321328
expect(findOptions(config, 'sass', 'sass')).toMatchObject({
322329
prependData,
323330
sassOptions: {
324-
indentedSyntax: true
331+
indentedSyntax: true,
332+
includePaths: ['./src/styles']
325333
},
326334
sourceMap: false
327335
})

packages/@vue/cli-service/lib/config/css.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ module.exports = (api, rootOptions) => {
204204
loaderOptions.sass,
205205
{
206206
sassOptions: Object.assign(
207-
(loaderOptions.sass && loaderOptions.sass.sassOptions) || {},
207+
{},
208+
loaderOptions.sass && loaderOptions.sass.sassOptions,
208209
{
209210
indentedSyntax: true
210211
}

0 commit comments

Comments
 (0)