I'm using typescript and webpack to compile my ES+ code down to ES5, with each module contained in its own output bundle.
For example:
class User {} = 1.js
class Table {} = 2.js
When looking at the output I'm noticing duplicate functions across the bundles, e.g:
__decorate
__awaiter
__generator
These are obviously helpers from the transpile down to ES5, is there any way to move these into a shared bundle to reduce duplication?
This is achieved with importHelpers
compiler option. It imports all helper functions in every place they are needed.
It requires to install tslib
package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With