Use polyfills
Transpiling your code is not quite enough to ensure legacy compatibility. Polyfills are the second step to ensuring legacy support.
Here are the recommended polyfills:
-
core-js
to polyfill core/common native features:Promise
,URL
,Object.assign
, array methods, and others. -
regenerator-runtime
to polyfill native generator functions. -
whatwg-fetch
to polyfill nativefetch
. -
fast-text-encoding
to polyfill nativeTextEncoder
.
NPM install example:
npm install core-js regenerator-runtime whatwg-fetch fast-text-encoding