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

What module format to use for UMD #54

Closed
patkujawa-wf opened this issue Oct 16, 2014 · 3 comments
Closed

What module format to use for UMD #54

patkujawa-wf opened this issue Oct 16, 2014 · 3 comments

Comments

@patkujawa-wf
Copy link

Does jspm support umdjs/umd and, if so, what format should be specified for them?

@guybedford
Copy link
Member

UMD is a combination of formats, so it is supported by jspm.

Detection happens in order from ES6, AMD, CommonJS and global.

So UMD will usually be detected as AMD.

You can change a UMD module to be detected as CommonJS or global though if needed by setting the format in the package.json or override.

@patkujawa-wf
Copy link
Author

So if it's UMD, we can leave out the format setting or we can set it to any of the others, basically? Thanks for clarifying! :)

@guybedford
Copy link
Member

Usually it will detect UMD as AMD, and treat it just like an AMD module, triggering the AMD part of the UMD detection.

This can sometimes go wrong though, in which case it can be useful to set the format explicitly to AMD or global if the UMD module as AMD isn't working.

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