G
G
Gvozdev952021-07-29 19:46:39
gulp.js
Gvozdev95, 2021-07-29 19:46:39

How to properly configure babel in gulp so that polyfills (and other questions) work?

Good afternoon. You need to make a landing that will work fine in ie11. To do this, I decided to connect babel to gulp simply through .pipe and a number of questions arose:
1) How to connect babel correctly so that the code is rewritten to the old syntax and polyfills are applied? In the documentation, it is not completely clear to me whether it is necessary to insert imports from corejs and regenerator runtime, whether they need to be written in plugins in presets, or webpack must be included.

2) Is it possible to somehow make babel add only those polyfills that are necessary for the site to work, and not all at once?

3) Explain clearly what is the difference between useBuiltIns: 'usage' , useBuiltIns: 'entry', useBuiltIns: 'false'. It's not clear to me in the documentation how they differ.

4) Is it normal practice to include webpack in gulp to import polyfills and other operations for js in small projects? And when can you join?

5) how to check that polyfills from corejs are connected?

6) is it normal that after adding polyfills from corejs the js file with my code, which weighed 7 kilobytes, began to weigh 80 kb?

7) is it normal that babel doesn't have polyfills for foreach, closest? Do they need to be added separately and what is the best way to do this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question