Skip to content

feat: add html-plugins-to-native-html codemod - #9

Draft
bjohansebas wants to merge 17 commits into
mainfrom
feat/html-plugins-to-native-html
Draft

feat: add html-plugins-to-native-html codemod#9
bjohansebas wants to merge 17 commits into
mainfrom
feat/html-plugins-to-native-html

Conversation

@bjohansebas

Copy link
Copy Markdown
Member

Summary

Adds the @webpack/html-plugins-to-native-html codemod, migrating html-webpack-plugin (plus html-loader and the csp/sri/favicons companion plugins) to webpack's native HTML support (experiments.html / output.html), including per-entry multi-page setups, hook-tap renames, and rewriting template files into HTML entry points.

What kind of change does this PR introduce?

feat

Did you add tests for your changes?

Yes — 25 fixture cases under codemods/html-plugins-to-native-html/tests/ plus 2 remove-dependencies cases.

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?

The codemod's README documents every mapping; the Codemod Registry entry is published from codemod.yaml.

Use of AI

This codemod was written with Claude Code (Claude Fable 5) under human direction and review: the option/hook mappings were verified against the webpack and html-webpack-plugin sources, and all fixtures, lint, and type checks pass locally.

@changeset-bot

changeset-bot Bot commented Aug 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 245a8e2

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

This PR includes changesets to release 1 package
Name Type
@webpack/html-plugins-to-native-html 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

@avivkeller
avivkeller self-requested a review August 3, 2026 04:01
@avivkeller

Copy link
Copy Markdown
Member

(Adding myself as a reviewer so it'll ping me when it's ready for review xD)

@AugustinMauroy

Copy link
Copy Markdown

if you need 👀 on your pr, I can help

Comment on lines +12 to +17
"repository": {
"type": "git",
"url": "git+https://github.com/webpack/codemods.git",
"directory": "codemods/html-plugins-to-native-html",
"bugs": "https://github.com/webpack/codemods/issues"
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since it's not shallow by the codemod Registry and not going to be publish on npm registry you can remove it. it's reduce maintenance

nodejs/userland-migrations#513

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npx codemod run @webpack/html-plugins-to-native-html
```

## Example

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use diff it's much more simpler to read and get what change

@AugustinMauroy

Copy link
Copy Markdown

also general recommendation, don't use node.kind()==='foo' instead use node.is('foo')

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.

3 participants