Skip to content

Commit c0baf05

Browse files
committed
fix: fix sassOptions merging for scss syntax in sass-loader v8 (vuejs#4631)
fixes vuejs#4630 (cherry picked from commit ebdb142)
1 parent bc6433a commit c0baf05

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
@@ -191,7 +191,10 @@ test('css.loaderOptions', () => {
191191
css: {
192192
loaderOptions: {
193193
sass: {
194-
prependData
194+
prependData,
195+
sassOptions: {
196+
includePaths: ['./src/styles']
197+
}
195198
}
196199
}
197200
}
@@ -200,12 +203,17 @@ test('css.loaderOptions', () => {
200203

201204
expect(findOptions(config, 'scss', 'sass')).toMatchObject({
202205
prependData,
203-
sourceMap: false
206+
sourceMap: false,
207+
sassOptions: {
208+
includePaths: ['./src/styles']
209+
}
204210
})
211+
expect(findOptions(config, 'scss', 'sass').sassOptions).not.toHaveProperty('indentedSyntax')
205212
expect(findOptions(config, 'sass', 'sass')).toMatchObject({
206213
prependData,
207214
sassOptions: {
208-
indentedSyntax: true
215+
indentedSyntax: true,
216+
includePaths: ['./src/styles']
209217
},
210218
sourceMap: false
211219
})

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ module.exports = (api, options) => {
196196
loaderOptions.sass,
197197
{
198198
sassOptions: Object.assign(
199-
(loaderOptions.sass && loaderOptions.sass.sassOptions) || {},
199+
{},
200+
loaderOptions.sass && loaderOptions.sass.sassOptions,
200201
{
201202
indentedSyntax: true
202203
}

0 commit comments

Comments
 (0)