Skip to content

Commit b4c4cc3

Browse files
justin808claude
andcommitted
Fix SCSS rule detection to use correct RegExp test method
Changed from incorrect '.scss'.match(rule.test) to correct rule.test.test('.scss') in webpack configuration. The previous code was calling match() on a string with a RegExp parameter, when it should use the RegExp's test() method to check if a string matches the pattern. Fixed in both: - spec/dummy/config/webpack/commonWebpackConfig.js - react_on_rails_pro/spec/dummy/config/webpack/commonWebpackConfig.js 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent c59ea77 commit b4c4cc3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

react_on_rails_pro/spec/dummy/config/webpack/commonWebpackConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const baseClientWebpackConfig = generateWebpackConfig();
2929

3030
// Add sass-resources-loader to all SCSS rules
3131
baseClientWebpackConfig.module.rules.forEach((rule) => {
32-
if (Array.isArray(rule.use) && rule.test && '.scss'.match(rule.test)) {
32+
if (Array.isArray(rule.use) && rule.test && rule.test.test('.scss')) {
3333
rule.use.push(sassLoaderConfig);
3434
}
3535
});

spec/dummy/config/webpack/commonWebpackConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const sassLoaderConfig = {
2525
baseClientWebpackConfig.module.rules.forEach((rule) => {
2626
if (Array.isArray(rule.use)) {
2727
// Add sass-resources-loader to all SCSS rules (both .scss and .module.scss)
28-
if (rule.test && '.scss'.match(rule.test)) {
28+
if (rule.test && rule.test.test('.scss')) {
2929
rule.use.push(sassLoaderConfig);
3030
}
3131

0 commit comments

Comments
 (0)