-
Notifications
You must be signed in to change notification settings - Fork 133
Description
I faced some difficulties when trying to make a fix in three-vrm
.
The published contents of @pixiv/three-vrm
contained .js
files that bundle all subpackages together, but the .d.ts
still reference individual subpackages from @pixiv/three-vrm-*
. Additionally, these subpackages are listed as "dependencies" of three-vrm
even though their code is already bundled. These dependencies are only used to provide types for the bundle.
This causes the following issues:
- Users download unused
.js
bundles for each subpackage tonode_modules
- Type definitions for
three-vrm
can get desynchronized from the actual.js
code
For example, I tried to fork the repo to make a small change. After building and publishing three-vrm
to my own namespace, I experienced strange build errors. Even though my published .js
files contained the desired changes, the types were still pointing at the unchanged upstream three-vrm-core
package. This means I'd have to publish each subpackage individually to my namespace!
A solution I adopted in my fork is to bundle the types for three-vrm
using tsup. This means the published .js
and .d.ts
files are sure to be in sync, and subpackages are no longer required as "dependencies".
Here is the change: mattrossman@3c1e258
This might make it easier for folks in the community to make fixes, while also reducing the package's footprint in node_modules :)
This shouldn't affect users who wish to install the subpackages individually.
node_modules before |
node_modules after |
---|---|
![]() |
![]() |
Just a suggestion—I can make a PR for this if you're interested, otherwise feel free to close.