Install only necessary bundling dependencies
ksenginew opened this issue · comments
currently microbundle installs a lot of dependencies with it.
Lines 70 to 113 in 105a09b
but some of these are not useful for some users as they don't use that things in their package.
As an example:- for a JavaScript library without any typescript code doesn't require typescript tslib of any other typescript related build tools. so it would be bedder if you can mark these dependencies as optional with peerDependenciesMeta option. this would make small install times and faster builds.
Thank you for this great project. I would be like to make a pr for this improvement.
this would make small install times and faster builds
Any benefit from fewer deps is almost certainly offset by the poor DX that is users needing to wrangle peerDeps if they want Microbundle to build CSS or TS.
Build times shouldn't be affected in any way.
@rschristian I think installing packages like typescript is useless for a pure js codebase. Anyway thanks for the clarification. 😸
TS can also be used to generate TS types for JS sources, for what it's worth. It's not something limited to those who author in TS.
I agree, the situation isn't ideal, but peer dependencies aren't a great DX. Slightly reducing the download size isn't worth it IMO.
I'm going to close this out as I don't think it's something worth pursuing.