faceyspacey / faceyspacey/extract-css-chunks-webpack-plugin
Support onlyLocals parameters in css-loader
- Dominant language
- JavaScript
- Stars
- 693
- Forks
- 83
- PR merge metrics
- No merged PRs in 30d
Description
if enable `onlyLocals` in [css-loader](https://github.com/webpack-contrib/css-loader#onlylocals) i get error. `onlyLocals` remove generation css content in SSR
```
TypeError: Cannot read property 'length' of undefined
at CssModule.size (/Users/User/job/platform-cli/node_modules/extract-css-chunks-webpack-plugin/dist/index.js:58:25)
at Chunk.integratedSize (/Users/User/job/platform-cli/node_modules/webpack/lib/Chunk.js:548:42)
at orderedChunks.forEach (/Users/User/job/platform-cli/node_modules/webpack/lib/optimize/LimitChunkCountPlugin.js:96:33)
at Array.forEach ()
at compilation.hooks.optimizeChunksAdvanced.tap.chunks (/Users/User/job/platform-cli/node_modules/webpack/lib/optimize/LimitChunkCountPlugin.js:92:20)
at SyncBailHook.eval [as call] (eval at create (/Users/User/job/platform-cli/node_modules/tapable/lib/HookCodeFactory.js:19:10), :12:16)
at SyncBailHook.lazyCompileHook (/Users/User/job/platform-cli/node_modules/tapable/lib/Hook.js:154:20)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the css-loader `onlyLocals` case and start at `node_modules/extract-css-chunks-webpack-plugin/dist/index.js:58`, where `CssModule.size` fails, then inspect the related webpack chunk-size path in the stack trace. Done means `onlyLocals` builds without the reported TypeError while preserving normal CSS extraction behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100