Edoardo Luppi
08/09/2023, 4:36 PMmodule-b
, which depends on module-a
, without having K/JS bundle both of them together in a single npm library.
I'd like module-b
to be compiled separately, and depend on the npm version of module-a
Both modules are Node.js libraries.turansky
08/09/2023, 5:31 PMEdoardo Luppi
08/09/2023, 5:42 PMmodule-b
, it's going to duplicate all module-a
content (which also means additional size)turansky
08/09/2023, 5:43 PMturansky
08/09/2023, 5:45 PMturansky
08/09/2023, 5:47 PMEdoardo Luppi
08/09/2023, 5:51 PMmodule-a
, and a client of module-b
can just bring in the newer version of module-a
.
DCE might miss stuff, but you get two lightweight packages instead of a light one and an heavy one because of duplication.
Now, maybe I'm overthinking, in which case I'd be happy to just ditch the entire argument.turansky
08/09/2023, 5:54 PMEdoardo Luppi
08/09/2023, 5:55 PMandylamax
08/10/2023, 7:22 AMEdoardo Luppi
08/10/2023, 7:41 AMandylamax
08/10/2023, 7:42 AMEdoardo Luppi
08/10/2023, 7:43 AMandylamax
08/10/2023, 7:45 AMEdoardo Luppi
08/10/2023, 7:45 AMmodule-b
, which depends on module-a
, i find both of them in an npm package named module-b
andylamax
08/10/2023, 7:49 AMpackage.json
). All its dependencies should be declared in the dependencies
or (peer|optional)Dependencies
of the generated package.json
file, and should import the declaration as a normal javascript libraryEdoardo Luppi
08/10/2023, 7:54 AMandylamax
08/10/2023, 8:11 AMCaleb
01/14/2025, 3:35 PMmodule-a
, module-b
, common
). Both module-a
and module-b
depend on common
. The common module is bundled in both modules. It also looks like each module is getting a subset of the Kotlin standard library bundled with it instead of sharing the dependency.Edoardo Luppi
01/14/2025, 3:38 PMturansky
01/14/2025, 3:39 PMmodule-a
and module-b
- applications or libraries (in your case)?Caleb
01/14/2025, 3:41 PMEdoardo Luppi
01/14/2025, 3:43 PMA > C < B
too, and parts of C ends up in both of them, depending on the amount of API usages.Caleb
01/14/2025, 3:56 PMEdoardo Luppi
01/14/2025, 3:58 PM@JsExport
), instead of outputting something different every time.
Overall my suggestion is to not overthink it. Let's say you want to publish A, B, C. You'll publish them as self contained packages and that's it.Edoardo Luppi
01/14/2025, 4:00 PMEdoardo Luppi
01/14/2025, 4:04 PMEdoardo Luppi
01/14/2025, 4:05 PMCaleb
01/14/2025, 4:12 PMEdoardo Luppi
01/14/2025, 5:52 PM