Reputation: 23607
I have a situation where I would like all stylus files to use the webpack loaders...
{
test: /\.styl$/,
loaders: ["to-string", "css", "stylus"]
},
but on global style files (ones ending in .global.styl
), I would like to use a different set of loaders...
loaders: ["style", "css", "stylus"]
I tried the following...
{
test: /.*(?<!global)\.styl$/,
loaders: ["to-string", "css", "stylus"]
},
But it didn't work...
SyntaxError: Invalid regular expression: /.*(?<!global)\.styl$/: Invalid group
Upvotes: 0
Views: 574
Reputation: 5292
You can try with not a ^ as follow:
// First case: someFiles.styl ending with .style
{
test: /.*[^\.global]\.styl$/,
loaders: ["to-string", "css", "stylus"]
},
// Second case: someFiles.global.styl ending with .global.styl
{
test: /.*[\.global]\.styl$/,
loaders: ["different", "loaders", "stylus"]
},
Upvotes: 1