Closed orangebokov closed 8 months ago
Sorry, what are you after? The last two code blocks are functionally identical.
Thanks for the answer.
Then when you import this library into the main project and build the main project using rollup
, tree shaking will not work.
Because all functions will be stored in one variable.
If they are exported separately, tree shaking will remove the unused ones.
P.S. There will be many functions in this library. many of them will not be used. I wish rollup didn't import them.
Because all functions will be stored in one variable.
That's not what this is.
export { foo, bar }
is exporting a list of values, not merging them. You might want to give MDN a skim and brush up on syntax. This is equivalent to what you want, saves a few bytes is all.
This isn't an issue here. If treeshaking isn't working, it's for other reasons.
Thank you for paying attention to this. All the best to you.
No problem, and if you do find an issue w/ Microbundle's output I'd be happy to reopen this & look at it.
Good afternoon, i'm asking for a little help.
If i have
index.ts
like this:Then bundle
index.esm.js
will be something like this:How to keep exports individual in bundle like this:
Thank you very much in advance!