I have file tree like app/components/forms/components/formError/components
I need to write a rule that tests all .scss
files that are only inside root components
or inside scene
folder. How can I do this?
The current rule is next:
{
test: /.*\/(components|scenes)\/.*\.scss$/,
use: [{
loader: 'style-loader',
}, {
loader: 'css-loader',
options: {
modules: true,
localIdentName: '[local]___[hash:base64:5]',
},
}, {
loader: 'sass-loader',
}],
}
but it didn't find required files
You may use
/(components|scenes).*\.scss$/
Details
(components|scenes)
- matches the first components
or scenes
substring.*
- any 0+ chars, as many as possible, up to the \.scss$
- .scss
at the end of the string.See this regex demo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With