S
S
Sounryyy2022-01-11 21:49:02
webpack
Sounryyy, 2022-01-11 21:49:02

webpack + babel. How to polyfill Nullish Coalescing (??) in a bundle (does not polyfill only libraries)?

The Nullish Coalescing operator (??) is not polyfilled in the lib bundle
.
Compilation inside the project proceeds as required

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
haiarha, 2022-01-20
@haiarha

If the application code is correctly polyfilled, then an additional plugin is not needed (it is already in the package lock, bundled with the babel preset).
And what you need is to include for the polyfill plugins in node_modules that contain unsupported (not transpiled) code.
This is done in the babel-loader configuration (node_modules are usually excluded). https://webpack.js.org/loaders/babel-loader/#usage

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question