Replies: 8 comments 3 replies
-
Is UMD build supported now? I want to use Code Bundling Shared Bundles functionality in Parcel 2 for my project. Or is any way I can expose it to a window variable. |
Beta Was this translation helpful? Give feedback.
-
I also use this feature from v1. I'm glad to see in this discussion that there are others who do. But I'm skeptical that this discussion will turn into an action item for the Parcel dev team. Perhaps we should create a Feature Request issue? |
Beta Was this translation helpful? Give feedback.
-
please add support for umd |
Beta Was this translation helpful? Give feedback.
-
It's a workaround to attach it to window. |
Beta Was this translation helpful? Give feedback.
-
There is a For now, in the entry file, you can make the mapping directly in the window['myGlobal'] = class {
static myFunction(prop) {
...
}
} |
Beta Was this translation helpful? Give feedback.
-
You should be able to generate a UMD package via the following property in your {
"browser": "<path>/<to>/<package>.umd.js",
} |
Beta Was this translation helpful? Give feedback.
-
Still nothing? What are some alternatives that are faster than webpack |
Beta Was this translation helpful? Give feedback.
-
Just wanted to reference my comment on the issue related to this discussion: #7312 (comment) In short, Parcel does appear to emit UMD code (at least in particular configurations) but does not provide any mechanism to define the name for the Global variable it will make. Providing that we can get some consensus on how best to configure the name, we could have a PR for this ready soon! |
Beta Was this translation helpful? Give feedback.
-
Greetings, I've looked through the documentation as well as the issues but can't seem to find a relevant one.
In parcel v1, we can use cli build
This may seem like a very basic question, but how to output an
UMD
module using Parcel V2 ?(So that the script can be imported via a
<script>
tag in browser and the module will be attached to the window object)I've noticed that in the documentation that is it still not possible in V2. If that's the case, when will V2 add support for bundling
UMD
module ?My current workaround is installing separate parcel version as alias and use that to output an
UMD
module, which isn't ideal, obviously.Beta Was this translation helpful? Give feedback.
All reactions