-
-
Notifications
You must be signed in to change notification settings - Fork 3
Should mark package.json dependencies as external by default #42
Comments
Another benefit to doing so is that it becomes clear on bundlephobia what is taking up space: This is the example before marking dependencies as external: This is the same package after marking dependencies as external: |
Of course. Please PR it. |
@rstoenescu cool thanks! I'll PR asap!! |
Love this idea! Thanks Luca! @mesqueeb |
I wonder if this would accomplish something similar: |
Ok, I am not so thrilled with this concept any longer. I tried it out on a few projects with bad results. The issue I had was using an external dependency as a mix-in. This caused rollup to not bundle the dep, which would then require the user to have a way to use it with UMD and that mix-in does not have a UMD equivalent. |
@hawkeye64 the idea is to set all dependencies as external, but only for For UMD build, as you mention, it's better that all dependencies do get bundled with the result. 😉 |
Ah, I see. That would be better. Still looking forward to your PR then. :) |
I'm just thinking that for the
es
andcjs
builds, it should mark all package.json dependencies as external by default:Not doing so will include all dependencies as part of the resulting built files. This gives webpack of developers who import your package a harder time eliminating duplicate dependencies.
Please note that passing them as "external" in rollup, they don't need to be added as peer dependency. They will be installed automatically when a dev does
npm i
oryarn add
on your package.The text was updated successfully, but these errors were encountered: