Support generating a UMD bundle
See original GitHub issueChoose 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 via myLibrary.Foo()
. Both rollup and webpack allow you to specify a config similar to
output: {
file: 'dist/styled-components.js',
format: 'umd',
name: 'styled',
exports: 'named',
}
It would be awesome if parcel supported something similar and wasn’t strictly for server/html code.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:26
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Build Rollup UMD bundle for CommonJS - remarkablemark
To generate a UMD bundle with MyModuleName as the export name: npx rollup index.js --file dist/bundle.js --format umd --name 'MyModuleName'
Read more >How to enable building UMD bundle again with Angular 13
I tried to find a way to enable building the UMD bundle again but was not ... There seems to be a way...
Read more >Create and Publish a Universal JavaScript Module - Medium
Real example how to create a universal open-source javascript module that will work in both browser and NodeJS environments and publish to ...
Read more >How to easily create JS libraries with bundled dependencies ...
experiments.outputModule = true - This is experimental and might result in empty umd output config.experiments.outputModule ...
Read more >Standalone Builds - SurviveJS
To make the generated bundle work in different environments, bundlers support Universal Module Definition (UMD). The UMD wrapper allows the code to be ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed by #453. Modules are now exposed to CommonJS and AMD automatically, and if you specify a
--global <name>
flag, as a global variable.Need umd/iife format in v2 it is expected to bundle all dependencies into the final bundle expect the native node modules. I guess your workaround won’t handle the dependencies bundling problem.