create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Are polyfills always injected in bundle?

Open Facj opened this issue 1 year ago • 1 comments

Polyfills are mentioned in several issues as injected in the bundle (https://github.com/facebook/create-react-app/issues/3397#issuecomment-341754187, https://github.com/facebook/create-react-app/issues/2696#issuecomment-312184589). However, I have used wepack-license-plugin to extract the licenses of an Ionic React app built with create-react-app and polyfills are not included.

Is it possible that polyfills packages are actually not included in the bundle? Are they included in every app whose bundle is created with CRA or only in some of them?

These are my package.json file and the output of the webpack-license-plugin: package.json thirdPartyNotice.json

The alternative it that polyfills are actually injected but not detected by the plugin, I have asked about this possibility here.

Facj avatar Dec 16 '24 09:12 Facj

What does "injected" mean in this context? Did you run webpack-bundle-analyzer on your build output to see if those polyfills are included?

codepunkt avatar Mar 01 '25 09:03 codepunkt