Skip to content

Remove including wp-polyfill with default create-block generation #35410

Closed
@mkaz

Description

What problem does this address?

The default wp-scripts will include the polyfills dependency due to this line

With the support for IE11 removed, we no longer need the polyfill by default. It adds additional overhead with little gain, see #35038 for more details.

What is your proposed solution?

The easiest to solve would be to just remove the injectPolyfills: true from wp-scripts webpack config. I'm not sure if this would cause problems with backward compatibility or not.

An alternate would be to setup and environment variable to trigger polyfills, ideally we default it to false and then instruct people who need it to set to true. Suggestion: WP_WEBPACK_USE_POLYFILLS

We could then change the config line to: injectPolyfill: process.env.WP_WEBPACK_USE_POLYFILLS

Thoughts? cc: @gziolo @ryanwelcher @aristath

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions