Skip to content

Fix: remove polyfill package#121

Merged
krishan711 merged 2 commits into
mainfrom
removepolyfill
Mar 16, 2026
Merged

Fix: remove polyfill package#121
krishan711 merged 2 commits into
mainfrom
removepolyfill

Conversation

@krishan711

Copy link
Copy Markdown
Contributor

Description

Checklist:

  • I have updated the CHANGELOG with a summary of my changes

Copilot AI review requested due to automatic review settings March 16, 2026 12:02
@krishan711 krishan711 merged commit 09ee640 into main Mar 16, 2026
7 checks passed
@krishan711 krishan711 deleted the removepolyfill branch March 16, 2026 12:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the vite-plugin-node-polyfills integration (and its custom shim/alias workaround) from the React App Vite build config, and adjusts Rolldown’s code-splitting behavior.

Changes:

  • Remove vite-plugin-node-polyfills usage from scripts/react-app-vite/app.config.js, including the custom node:module shim and shim alias resolution workaround.
  • Delete the now-unused scripts/react-app-vite/moduleShim.js.
  • Drop vite-plugin-node-polyfills from dependencies/lockfile, and enable includeDependenciesRecursively for Rolldown code splitting.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
scripts/react-app-vite/moduleShim.js Removes the browser stub shim for node:module (file deleted).
scripts/react-app-vite/app.config.js Removes node polyfill plugin + related shim alias plumbing; tweaks Rolldown code-splitting recursion.
package.json Removes vite-plugin-node-polyfills from dependencies.
package-lock.json Removes transitive dependencies pulled in by vite-plugin-node-polyfills.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 43 to 47
return defineConfig({
plugins: [
pluginReactSwc(),
nodePolyfills({
// NOTE(krishan711): Use 'build' only for globals to avoid shim resolution issues in dev.
// See: https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/140
globals: {
Buffer: 'build',
global: 'build',
process: 'build',
},
overrides: {
module: moduleShimPath,
},
}),
createShimsResolverPlugin(),
...(params.addHtmlOutput ? [createIndexPlugin({ templateFilePath: indexTemplateFilePath, name, entryFilePath: params.entryFilePath })] : []),
...(params.addRuntimeConfig ? [createRuntimeConfigPlugin({ vars: runtimeConfigVars })] : []),
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