Skip to content

Commit a9a4412

Browse files
committed
fix: stylePostLoader injection for windows flat node_modules
close #1284
1 parent fb7d695 commit a9a4412

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/loaders/pitcher.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports.pitch = function (remainingRequest) {
1313
const loaders = this.loaders.slice(1) // remove self
1414

1515
// do not inject if user uses null-loader to void the type (#1239)
16-
if (loaders.some(l => /(\/|\\)null-loader/.test(l.path))) {
16+
if (loaders.some(l => /(\/|\\|@)null-loader/.test(l.path))) {
1717
return
1818
}
1919

@@ -45,8 +45,8 @@ module.exports.pitch = function (remainingRequest) {
4545

4646
// Inject style-post-loader before css-loader for scoped CSS and trimming
4747
if (query.type === `style`) {
48-
const cssLoaderIndex = loaders.findIndex(l => /(\/|\\)css-loader/.test(l.path))
49-
if (cssLoaderIndex) {
48+
const cssLoaderIndex = loaders.findIndex(l => /(\/|\\|@)css-loader/.test(l.path))
49+
if (cssLoaderIndex > -1) {
5050
const afterLoaders = loaders.slice(0, cssLoaderIndex + 1)
5151
const beforeLoaders = loaders.slice(cssLoaderIndex + 1)
5252
const request = genRequest([

0 commit comments

Comments
 (0)