-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Support generating a UMD bundle #766
Comments
I too would be able to use Parcel more if this was supported. It is equivalent to WebPack's |
Related: #453 |
It is also equivalent to Rollup's output.format option. https://rollupjs.org/guide/en#command-line-flags
|
Fixed by #453. Modules are now exposed to CommonJS and AMD automatically, and if you specify a |
UMD... |
This work for me, but there sames no way to expose // lib.js
export default { ... } then run <!-- index.htm -->
<script src'./lib.js'></script>
<script>
console.log(mylib)
</script> the out put is: Thanks ! |
You cannot use ESM exports for that. |
@devongovett is UMD still supported in Parcel 2? I see no mention of it in the docs - should we re-open this issue? Thanks! 🙇 |
@niieani - I'm not sure why this is not in V2, but here is my workaround: window['MyGlobalName'] = myGlobalVar; |
Need umd/iife format in v2 |
Choose one: feature request?
Right now, parcel is used for compiling code to be used for a frontend server. There's no way to create a named library that you can use drop in a
<script src='...'>
tag and call viamyLibrary.Foo()
. Both rollup and webpack allow you to specify a config similar toIt would be awesome if parcel supported something similar and wasn't strictly for server/html code.
The text was updated successfully, but these errors were encountered: