Skip to content

Commit

Permalink
fix: loader check for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 22, 2018
1 parent 42141c0 commit ab067b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/loaders/pitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports.pitch = function (remainingRequest) {

// Inject style-post-loader before css-loader for scoped CSS and trimming
if (query.type === `style`) {
const cssLoaderIndex = loaders.findIndex(l => /\/css-loader/.test(l.request))
const cssLoaderIndex = loaders.findIndex(l => /(\/|\\)css-loader/.test(l.request))
if (cssLoaderIndex) {
const afterLoaders = loaders.slice(0, cssLoaderIndex + 1).map(toLoaderString)
const beforeLoaders = loaders.slice(cssLoaderIndex + 1).map(toLoaderString)
Expand Down
2 changes: 1 addition & 1 deletion lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = class VueLoaderPlugin {
const normalizedVueUse = normalizedVueRule.use.map(cleanUse)
// get vue-loader options
const vueLoaderUseIndex = normalizedVueUse.findIndex(u => {
return /^vue-loader|\/vue-loader/.test(u.loader)
return /^vue-loader|(\/|\\)vue-loader/.test(u.loader)
})

if (vueLoaderUseIndex < 0) {
Expand Down

0 comments on commit ab067b0

Please sign in to comment.