Use immutable updates for CSS loader configuration
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- javascript, webpack
- Domain
- build-system
Research direction
Start in config/webpack/commonWebpackConfig.js at lines 49-61 and 80-96, then compare the immutable pattern in serverWebpackConfig.js. Update the CSS and Sass loader configuration so nested options are not mutated directly. Verify that the webpack configuration preserves the intended loader settings without modifying shared defaults.
Written by the indexing model from the issue text.
Description
Issue
Currently in config/webpack/commonWebpackConfig.js:49-61, we directly mutate nested loader options:
if (cssLoader?.options?.modules) {
cssLoader.options.modules.namedExport = false;
cssLoader.options.modules.exportLocalsConvention = 'camelCase';
}
This risks affecting shared objects from Shakapacker's defaults.
Solution
Use object spread for immutability (already done correctly in serverWebpackConfig.js):
if (cssLoader?.options?.modules) {
cssLoader.options.modules = {
...cssLoader.options.modules,
namedExport: false,
exportLocalsConvention: 'camelCase',
};
}
Related
Similar pattern needed in Sass loader configuration (lines 80-96).
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 370
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from shakacode/react-webpack-rails-tutorial
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 42/100
shakacode/react-webpack-rails-tutorial#731 · 1 comment ·
-
documentation
Difficulty 4/5 3-5 days Newbie friendliness 50/100
-
question
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 28/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
All issues in shakacode/react-webpack-rails-tutorial
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100