Skip to content

Commit ab067b0

Browse files
committed
fix: loader check for windows
1 parent 42141c0 commit ab067b0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: lib/loaders/pitch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports.pitch = function (remainingRequest) {
3131

3232
// Inject style-post-loader before css-loader for scoped CSS and trimming
3333
if (query.type === `style`) {
34-
const cssLoaderIndex = loaders.findIndex(l => /\/css-loader/.test(l.request))
34+
const cssLoaderIndex = loaders.findIndex(l => /(\/|\\)css-loader/.test(l.request))
3535
if (cssLoaderIndex) {
3636
const afterLoaders = loaders.slice(0, cssLoaderIndex + 1).map(toLoaderString)
3737
const beforeLoaders = loaders.slice(cssLoaderIndex + 1).map(toLoaderString)

Diff for: lib/plugin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = class VueLoaderPlugin {
2727
const normalizedVueUse = normalizedVueRule.use.map(cleanUse)
2828
// get vue-loader options
2929
const vueLoaderUseIndex = normalizedVueUse.findIndex(u => {
30-
return /^vue-loader|\/vue-loader/.test(u.loader)
30+
return /^vue-loader|(\/|\\)vue-loader/.test(u.loader)
3131
})
3232

3333
if (vueLoaderUseIndex < 0) {

0 commit comments

Comments
 (0)