You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set up Babel transpilation using @babel/preset-env to transform modern JavaScript code so it runs without errors in <script type="module"> ES module scripts (see .browserlistrc supported browsers).
Polyfill libraries like core-js can be considered later.
Why
We want to maximise the chances of JavaScript running properly in browsers that will load our JavaScript.
Transformed code should not cause parsing or syntax errors. Since feature detection can guard against code we choose not to run, unsupported browser APIs don't have to be transformed.
What
Set up Babel transpilation using
@babel/preset-env
to transform modern JavaScript code so it runs without errors in<script type="module">
ES module scripts (see.browserlistrc
supported browsers).Polyfill libraries like
core-js
can be considered later.Why
We want to maximise the chances of JavaScript running properly in browsers that will load our JavaScript.
Transformed code should not cause parsing or syntax errors. Since feature detection can guard against code we choose not to run, unsupported browser APIs don't have to be transformed.
Who needs to work on this
Developers
Who needs to review this
Developers
Depends on
Done when
The text was updated successfully, but these errors were encountered: