Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

I'm confused by the module format documentation in the wiki #1069

Open
popham opened this issue Jan 31, 2018 · 2 comments
Open

I'm confused by the module format documentation in the wiki #1069

popham opened this issue Jan 31, 2018 · 2 comments

Comments

@popham
Copy link

popham commented Jan 31, 2018

I'm adding a jspm section to a library of mine, but I'm confused by Configuring-Packages-for-jspm. What does "Module format esm (ECMAScript Module) currently isn't used in package.json" mean? In particular, "isn't used" by whom?

@aluanhaddad
Copy link
Collaborator

By used it means used by JSPM. It actually is used. I think the documentation needs to be updated.

For example, say that the jspm section of your package specifies files that are distributed in a format other than CommonJS. This could be amd, esm, global, etc.

By specifying that property you provide metadata that enables the package to be loaded and bundled correctly.

For example, in the case of esm, people installing your package will be able to take advantage of rollup optimizations when they create a production build. It also means that the SystemJS loader doesn't have to attempt module format detection heuristics which enables your package to be transpiled faster and with no ambiguity as to format.

@aluanhaddad
Copy link
Collaborator

aluanhaddad commented Jan 31, 2018

Actually, I believe the documentation is saying that the property is not considered if it is not nested under the jspm section.

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

No branches or pull requests

2 participants