Skip to content

Commit 03101af

Browse files
committed
test(loaders): fix the tests
1 parent bec95f6 commit 03101af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ const findLoaders = (config, lang, index) => {
4444
if (!rule) {
4545
throw new Error(`rule not found for ${lang}`)
4646
}
47-
return rule.use.map(({ loader }) => loader.replace(/-loader$/, ''))
47+
return rule.use.map(({ loader }) => {
48+
const match = loader.match(/([^/]+)-loader/)
49+
return match ? match[1] : loader
50+
})
4851
}
4952

5053
const findOptions = (config, lang, _loader, index) => {

0 commit comments

Comments
 (0)