-
-
Notifications
You must be signed in to change notification settings - Fork 209
Support external svelte module with component main entry (svelte key in package.json) #28
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
Comments
Upon further study on how to implement, I actually not so sure if this is needed to be implement.
It seems to means the field isn't intended to be required to build. It's like the more commonly used 'source' field but a svelte version. And typescript's module-resolving doesn't support custom entry too. Maybe it could still be implemented but under some configuration with glob array to test for. |
There really isn't a standard for source, module, types, or browser. Even main isn't super well-defined. Hopefully MS fixes it now that they have control of npm, GitHub, and Typescript. I wish more projects did package up source it makes debugging and figuring out things so much better. /rant |
sounds like this is ok to close? |
Since it's much easier to manual type a component now there is not much need for this any more. I'll close this |
How can we manually type a component? |
I assume you talk about providing types as a library author. There is nothing official yet. For now the best way is to copy the contents of this class into your types and make all components extend that like export class YourComponent extends Svelte2TsxComponent<{...props...}, {...events..}, {...slots...}> {} |
Uh oh!
There was an error while loading. Please reload this page.
Originally posted by @jakobrosenberg in #9 (comment)
As @jakobrosenberg point out. The svelte key in external module's
package.json
is a special custom main entry for svelte component source. See rollup-plugin-svelte for more info. This custom entry should be consider when resolving svelte moduleThe text was updated successfully, but these errors were encountered: