Skip to content

Conversation

timaschew
Copy link
Member

No description provided.

This file will be returned when you require its component and autorequired by the build process.
It is recommended that you use "index.js" for the main component file.
If you omit the "main" field, the first file in the "scripts" array will be used.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically, it's the first file in the first .use()ed field you use, which by default is "scripts". however, that's implementation and this is specifications. specs only have to say that you should and that it defaults to index.js, implementation can do whatever it wants :P

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, what's about a note, that the behavior when requiring is different to node.js:
you only can require the main file, if you want to expose other files, the main file should "proxy" them.
in node.js you can require any file of a module by adding a relative path to the module name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants