File tree Expand file tree Collapse file tree 1 file changed +9
-25
lines changed
lib/generators/react_on_rails/templates/base/base/config/webpack Expand file tree Collapse file tree 1 file changed +9
-25
lines changed Original file line number Diff line number Diff line change @@ -9,33 +9,17 @@ const commonOptions = {
99 resolve: {
1010 extensions: ['.css', '.ts', '.tsx'],
1111 },
12+ module: {
13+ rules: [
14+ {
15+ test: /\.css$/i,
16+ use: ['style-loader', 'css-loader'],
17+ },
18+ ],
19+ },
1220};
1321
1422// Copy the object using merge b/c the baseClientWebpackConfig and commonOptions are mutable globals
15- const commonWebpackConfig = () => {
16- const config = merge({}, baseClientWebpackConfig, commonOptions);
17-
18- // Ensure CSS loader is properly configured
19- if (!config.module) {
20- config.module = {};
21- }
22- if (!config.module.rules) {
23- config.module.rules = [];
24- }
25-
26- // Add CSS loader rule if not already present
27- const hasCssRule = config.module.rules.some(rule =>
28- rule.test && rule.test.toString().includes('css')
29- );
30-
31- if (!hasCssRule) {
32- config.module.rules.push({
33- test: /\.css$/i,
34- use: ['style-loader', 'css-loader'],
35- });
36- }
37-
38- return config;
39- };
23+ const commonWebpackConfig = () => merge({}, baseClientWebpackConfig, commonOptions);
4024
4125module.exports = commonWebpackConfig;
You can’t perform that action at this time.
0 commit comments