-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Add types property to indicate the main declaration file #15700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add `types` property to indicate the main declaration file. [docs](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)
|
The published npm package does not contain the src folder🤔 |
|
How about we just ignore .js files in the src folder to reduce the size of npm package? |
|
@mrdoob we wanted to allow people to import from the src/ dir anyway right? May as well start including it I think. |
|
Just for my understanding: |
|
Completely redundant, yes. But at least the source files themselves are small, especially compared to
... In theory, this means build systems using ES modules are more likely to tree-shake the library effectively. But at the moment we have more hypotheses about how tree-shaking works than actual evidence... including them in the module without replacing the All that to say, I'm fine with including the |
|
@mrdoob Hi, So can you merge this PR? |
|
@LuWangThreekit @Methuselah96 I'm assuming this is the right file to use? We should be able to test this with just |
|
@donmccurdy Yeah, I just tested this locally and it works. There are some things that need to be fixed about the typings (they don't export all of their interfaces (e.g. |
|
|
Thanks! |
Add
typesproperty to indicate the main declaration file.docs