I cant quite get my head around why my loader tests are failing.
My goal:
Test 1:
Match anything that is not either global.css
or global.scss
Test 2
Only match either global.scss
or global.css
Reason being is i don't want any files named global to be passed through the module
options
Seems like my first test is letting global though. I can see both my regex are correctly returning true/false when using tools such as https://regex101.com/.
Could this be down to my include
?
Help! :)
webpack.config.js
{
test: /^(?!global\.s?css$).*\.s?css$/,
include: SRC_DIR,
use: extractPlugin.extract({
use: [
{
loader: 'css-loader',
options: {
modules: true,
camelCase: true
}
},
{
loader: 'postcss-loader',
options: {
plugins: (loader) => [require('autoprefixer')()]
}
},
'resolve-url-loader',
{
loader: 'sass-loader',
options: { sourceMap: true }
}
]
})
},
{
test: /^global\.s?css$/,
include: SRC_DIR,
use: extractPlugin.extract({
use: [
'css-loader',
{
loader: 'postcss-loader',
options: {
plugins: (loader) => [require('autoprefixer')()]
}
},
'resolve-url-loader',
{
loader: 'sass-loader',
options: { sourceMap: true }
}
]
})
}