Skip to content

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

Merged
bjohansebas merged 42 commits into
mainfrom
feat/html-plugins-to-native-html
Nov 8, 2026
Merged

bjohansebas merged 42 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: 91310b8

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')

@bjohansebas

Copy link
Copy Markdown
Member Author

if you need 👀 on your pr, I can help

I guess we can give you commit access. I’ve freed up a bit of time anyway, so I’ll keep working on this PR.

@avivkeller wdyt?

Translate supported HTML minification settings, preserve existing configuration and used dependencies, and apply template changes through AST workflow steps without filesystem APIs. Add regression and workflow tests covering dry runs and idempotence.
@bjohansebas
bjohansebas force-pushed the feat/html-plugins-to-native-html branch from 245a8e2 to 307e44d Compare November 7, 2026 17:40
@socket-security

socket-security Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcsp-html-webpack-plugin@​5.1.010010010075100
Addedwebpack@​5.112.2811009398100
Addedfavicons-webpack-plugin@​6.0.19910010083100
Addedhtml-loader@​5.1.010010010083100
Addedhtml-webpack-plugin@​5.6.89910010087100

View full report

@bjohansebas
bjohansebas marked this pull request as ready for review November 7, 2026 19:23
@bjohansebas
bjohansebas merged commit 5c0f0a1 into main Nov 8, 2026
10 checks passed
@bjohansebas
bjohansebas deleted the feat/html-plugins-to-native-html branch November 8, 2026 15:03
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