babel / gulp-babel

Gulp plugin for Babel
https://babeljs.io
MIT License
1.32k stars 120 forks source link

babel produce multiple duplicates in output bandle file #199

Closed WuglyakBolgoink closed 3 years ago

WuglyakBolgoink commented 4 years ago

Hallo guys!

I found some "feature bug" problem in our output bandle file.

Babel create x-same functions for each file which contain es6 class.

For example currently what we have:

  1. _classCallCheck - 133x
  2. ownKeys - 24
  3. _defineProperties - 198x

Can anyone help me with that or say how I can reduce count of this functions?

PS: we use old angularJS files together with new es6 classes...

nicolo-ribaudo commented 4 years ago

By default, Babel injects inline helpers in every file. You can use @babel/plugin-transform-runtime (and add @babel/runtime to your dependencies) to decuplicate them.

nicolo-ribaudo commented 3 years ago

Answered - https://github.com/babel/gulp-babel/issues/199#issuecomment-608409520