Skip to content

feat: add css-plugins-to-native-css codemod - #7

Merged
bjohansebas merged 59 commits into
mainfrom
feat/css-plugins-to-native-css
Aug 2, 2026
Merged

feat: add css-plugins-to-native-css codemod#7
bjohansebas merged 59 commits into
mainfrom
feat/css-plugins-to-native-css

Conversation

@bjohansebas

Copy link
Copy Markdown
Member

Summary

Adds the first codemod, @webpack/css-plugins-to-native-css, which migrates configurations from mini-css-extract-plugin and style-loader/css-loader rules to webpack's native CSS support, relying on the experiments.css: "auto" default from webpack >= 5.109.0. It also extracts the reusable ast-grep helpers into a shared @webpack/codemod-utils workspace for future codemods.

What kind of change does this PR introduce?

feat

Did you add tests for your changes?

Yes — 18 input/expected fixture pairs under codemods/css-plugins-to-native-css/tests/, covering ejected CRA configs, dev/prod guards, oneOf nesting, webpack-merge/function-form configs, CSS Modules, and non-migratable loader options.

Does this PR introduce a breaking change?

No.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Documented in the codemod's README.md, the root README.md table, and AGENTS.md/CONTRIBUTING.md (shared utilities workspace).

Use of AI

This PR was developed with Claude Code under my direction: I specified the migration semantics and reviewed each iteration; the AI wrote the transform, fixtures, and docs. Behavior was validated against real webpack 5.109 builds (including a real sass-loader chain).

@changeset-bot

changeset-bot Bot commented Aug 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3234308

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@webpack/css-plugins-to-native-css Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread .changeset/css-plugins-to-native-css.md Outdated
Comment thread codemods/css-plugins-to-native-css/package.json Outdated
Comment thread codemods/css-plugins-to-native-css/src/workflow.ts Outdated
Comment thread codemods/css-plugins-to-native-css/src/workflow.ts Outdated
Comment thread codemods/css-plugins-to-native-css/package.json Outdated
Comment thread packages/codemod-utils/src/index.ts Outdated
Comment thread packages/codemod-utils/package.json Outdated
Comment thread packages/codemod-utils/package.json Outdated
Comment thread package.json
Comment thread codemods/css-plugins-to-native-css/codemod.yaml Outdated
@bjohansebas

Copy link
Copy Markdown
Member Author

Okay, all that's left is the hooks part.

@bjohansebas
bjohansebas merged commit 5eb74e5 into main Aug 2, 2026
8 checks passed
@bjohansebas
bjohansebas deleted the feat/css-plugins-to-native-css branch August 2, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants