docs: use the built-in CSS support of webpack in examples - #740
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #740 +/- ##
=======================================
Coverage 88.23% 88.23%
=======================================
Files 3 3
Lines 357 357
Branches 118 118
=======================================
Hits 315 315
Misses 38 38
Partials 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Replace `style-loader`/`css-loader`/`mini-css-extract-plugin` in the documentation examples with `experiments.css` and the `css/auto` module type, and cover this setup with tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y38YLRaBZZKSrV2dRiFpi2
alexander-akait
force-pushed
the
claude/webpack-css-examples-tests-u6b8nj
branch
from
August 29, 2026 12:38
0434b31 to
b31e0a3
Compare
`npm run security` (`npm audit --omit=dev`) fails on the nested `js-yaml` of `cosmiconfig` (GHSA-h67p-54hq-rp68, GHSA-52cp-r559-cp3m, GHSA-5p4m-2wfm-xmqj). Lockfile-only bump from 4.1.1 to 4.3.2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces
style-loader/css-loader/mini-css-extract-pluginin the documentation examples with webpack's built-in CSS support (experiments.css+ thecss/automodule type), and adds tests for that setup.README
experiments: { css: true }andtype: "css/auto"on the rule, and dropsstyle-loader/css-loaderfrom the loader chain (along with theimportLoadersoptions that only existed forcss-loader).css/auto(*.module.css) with acss/modulevariant for treating all matched files as modules; the stalecss-loader#moduleslink now points at the CSS Modules spec.mini-css-extract-plugin— extraction is native, configured throughoutput.cssFilename/output.cssChunkFilename.sourceMap,implementation) had theirtestregex corrected to/\.s[ac]ss$/i— they matched.csswhile runningsass-loader.>= 5.87.0, and thatcss-loader/style-loaderstill work if preferred, withpostcss-loaderplaced before them.Tests
test/helpers/getCssCompiler.jscompiles fixtures throughexperiments.css+css/autowith nocss-loader-like loader in the chain.test/builtInCss.test.jscovers plain CSS, CSS modules, SugarSS,executewithpostcss-js, source maps in the emittedmain.css.map, and the invalid-syntax error path. Fixtures intest/fixtures/builtin-css/.test/fixtures/esparser/runManual.mjsno longer referencescss-loader(it is not a devDependency, so the manual runner was broken) and uses the built-in CSS pipeline.The existing unit tests keep
test/helpers/testLoader.js. With built-in CSS, webpack's CSS parser regenerates the module source as aRawSourceand drops the loader's source map at the module level, so the assertions insourceMap.test.jsabout the loader's own map (sources,sourcesContent, absolute paths) cannot be made against it — converting them would trade precise loader-output assertions for webpack's composed asset maps.Full suite passes (132 passed, 4 skipped) and
npm run lintis clean.Generated by Claude Code