Commit ab067b0f authored by Evan You's avatar Evan You

fix: loader check for windows

parent 42141c04
...@@ -31,7 +31,7 @@ module.exports.pitch = function (remainingRequest) { ...@@ -31,7 +31,7 @@ module.exports.pitch = function (remainingRequest) {
// Inject style-post-loader before css-loader for scoped CSS and trimming // Inject style-post-loader before css-loader for scoped CSS and trimming
if (query.type === `style`) { 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) { if (cssLoaderIndex) {
const afterLoaders = loaders.slice(0, cssLoaderIndex + 1).map(toLoaderString) const afterLoaders = loaders.slice(0, cssLoaderIndex + 1).map(toLoaderString)
const beforeLoaders = loaders.slice(cssLoaderIndex + 1).map(toLoaderString) const beforeLoaders = loaders.slice(cssLoaderIndex + 1).map(toLoaderString)
......
...@@ -27,7 +27,7 @@ module.exports = class VueLoaderPlugin { ...@@ -27,7 +27,7 @@ module.exports = class VueLoaderPlugin {
const normalizedVueUse = normalizedVueRule.use.map(cleanUse) const normalizedVueUse = normalizedVueRule.use.map(cleanUse)
// get vue-loader options // get vue-loader options
const vueLoaderUseIndex = normalizedVueUse.findIndex(u => { const vueLoaderUseIndex = normalizedVueUse.findIndex(u => {
return /^vue-loader|\/vue-loader/.test(u.loader) return /^vue-loader|(\/|\\)vue-loader/.test(u.loader)
}) })
if (vueLoaderUseIndex < 0) { if (vueLoaderUseIndex < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment