Conversation
kuitos
commented
Jan 10, 2026
- Remove type assertion, use proper Webpack types with compatibility check
- Fix Webpack 5 deprecated API usage
- Add Webpack 5 processAssets hook to avoid deprecation warning
- Preserve regex flags when appending 'g' flag
- Reset lastIndex to avoid global regex stateful matching issues
- Improve error handling by returning error objects instead of throwing
- Remove unused PackageJson type fields
- Add 6 unit tests for addEntryAttributeToScripts core logic
- Remove `as any` type assertion, use proper Webpack types with compatibility check - Fix Webpack 5 deprecated `jsonpFunction` API usage (only use `chunkLoadingGlobal`) - Fix Webpack 4 does not support `chunkLoadingGlobal` (only use `jsonpFunction`) - Add Webpack 5 processAssets hook to avoid deprecation warning - Preserve regex flags when appending 'g' flag - Reset lastIndex to avoid global regex stateful matching issues - Improve error handling by returning error objects instead of throwing - Remove unused PackageJson type fields - Add 6 unit tests for addEntryAttributeToScripts core logic BREAKING CHANGE: None - maintains Webpack 4 and 5 compatibility
🦋 Changeset detectedLatest commit: 29e3445 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Use feature detection instead of version detection for Webpack 4/5 compatibility - Remove `as any` type assertion, use proper Webpack types with compatibility check - Fix Webpack 5 deprecated `jsonpFunction` API usage (only use `chunkLoadingGlobal`) - Fix Webpack 4 does not support `chunkLoadingGlobal` (only use `jsonpFunction`) - Add Webpack 5 processAssets hook to avoid deprecation warning - Preserve regex flags when appending 'g' flag - Reset lastIndex to avoid global regex stateful matching issues - Improve error handling by returning error objects instead of throwing - Remove unused PackageJson type fields - Add 6 unit tests for addEntryAttributeToScripts core logic BREAKING CHANGE: None - maintains Webpack 4 and 5 compatibility
There was a problem hiding this comment.
Pull request overview
This PR refactors the webpack plugin package with a significant architectural change: renaming from @qiankunjs/webpack-plugin to @qiankunjs/bundler-plugin, and rewriting the plugin implementation to use html-webpack-plugin hooks instead of cheerio for HTML manipulation. The plugin is renamed from QiankunPlugin to QiankunWebpackPlugin.
Changes:
- Complete rewrite of the plugin using html-webpack-plugin hooks for better webpack integration
- Improved entry script detection using webpack's compilation.entrypoints API
- Removed regex-based pattern matching in favor of automatic detection
- Better error handling with graceful fallbacks instead of throwing errors
- Updated all templates, examples, and references across the codebase
Reviewed changes
Copilot reviewed 32 out of 39 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/bundler-plugin/src/webpack/index.ts | Complete rewrite of the webpack plugin with improved entrypoint detection |
| packages/bundler-plugin/package.json | Package renamed, version reset, exports field added, webpack marked as optional |
| packages/bundler-plugin/tests/plugin.test.ts | Replaced cheerio-based tests with integration tests using fixtures |
| packages/bundler-plugin/README.md | New documentation focusing on webpack entrypoints approach |
| packages/bundler-plugin/CHANGELOG.md | Changelog retained from old package |
| tsconfig.eslint.json | Updated test path reference |
| packages/create-qiankun/template//.ejs | Updated import and class names in all templates |
| examples/*/webpack.config.js | Updated import and class names in examples |
| docs/ecosystem/bundler-plugin.md | New concise documentation |
| docs/ecosystem/webpack-plugin.md | Old detailed documentation removed |
| AGENTS.md | New knowledge base file added |
| packages/*/AGENTS.md | New knowledge base files for packages |
Comments suppressed due to low confidence (2)
packages/bundler-plugin/package.json:40
- Webpack is marked as optional in peerDependenciesMeta, but the plugin is specifically a webpack plugin and will not function without it. This might cause confusion. If the intention is to support other bundlers in the future (as suggested by the package name "bundler-plugin"), consider keeping webpack optional, but document this clearly. Otherwise, webpack should be a required peer dependency.
packages/bundler-plugin/package.json:3 - The version has been reset from "0.0.1-rc.4" to "0.0.1-rc.0". This appears to be a regression as the CHANGELOG shows versions up to rc.4. The version should likely be "0.0.1-rc.5" or higher to maintain version progression.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
# Conflicts: # packages/create-qiankun/template/react18-webpack-sub/config-overrides.js # packages/create-qiankun/template/react18-webpack-sub/package.json.ejs # packages/create-qiankun/template/vue2-webpack-sub/package.json.ejs # packages/create-qiankun/template/vue2-webpack-sub/vue.config.js.ejs # packages/create-qiankun/template/vue3-webpack-sub/package.json.ejs # packages/create-qiankun/template/vue3-webpack-sub/vue.config.js.ejs # pnpm-lock.yaml