Microbundle: How to consume different bundles from package.json

Created on 22 Feb 2018  Â·  4Comments  Â·  Source: developit/microbundle

Hey,

I'm intereted in know how to define correctly each bundle at package.json.

For example, I know cjs bundle is the property main.

What happens with the rest? Could be a great resource to put into the readme 🙂

good first issue help wanted

Most helpful comment

Seems it is a specification from microbuldle and not offical? https://github.com/stereobooster/package.json#microbundle

All 4 comments

Definitely worth adding to the readme, yup.

"main": "dist/foo.js",          // CJS bundle
"umd:main": "dist/foo.umd.js",  // UMD bundle
"module": "dist/foo.m.js",      // ES Modules bundle
"source": "src/foo.js",         // custom entry module (same as 1st arg to microbundle)

Thank you for this.

I'm wondering where the umd:main property comes from?
Which bundlers use it? A search didn't get me far… And what about the browser field?

Seems it is a specification from microbuldle and not offical? https://github.com/stereobooster/package.json#microbundle

Already on docs 👌

Was this page helpful?
0 / 5 - 0 ratings

Related issues

breadadams picture breadadams  Â·  3Comments

sptimer picture sptimer  Â·  4Comments

SleeplessByte picture SleeplessByte  Â·  3Comments

retyui picture retyui  Â·  4Comments

kesla picture kesla  Â·  4Comments