Repository navigation
"esmodule" key not respected in v15.0.0 #963
Description
Activity
Cheers, thanks for spotting and reporting. I see the issue, but it seems we have a bit of a blind spot in the test suite for this so I'm trying to rectify that.
You will probably want to migrate to
"exports"anyhow (and looking at the linked repo, it seems you have) as"esmodule"never got a ton of support AFAICT.Reacted by Jason Millermake-github-pseudonymous-again commented
on May 19, 2022 AuthorMore actionsI'll try migrating to
"exports". Thanks @rschristian!make-github-pseudonymous-again commented
on May 20, 2022 AuthorMore actionsI tried using
exportswith the exact same filenames but it still wants to add.modernbefore.js:$ npm-run-all --parallel build:* $ microbundle --cwd packages/api --target web --format modern,cjs && cp -l packages/api/dist/api/src/mod.d.ts packages/api/dist/mod.d.ts $ microbundle --cwd packages/cli --target node --format modern Build "cli" to dist: 6.28 kB: main.modern.js.gz 5.57 kB: main.modern.js.br Build "api" to dist: 1.81 kB: mod.cjs.gz 1.6 kB: mod.cjs.br 1140 B: mod.modern.js.gz 978 B: mod.modern.js.brI guess I could just use
mod.modern.jsto make it work, but is this expected?Yes, sorry,
"exports"also will be affected by that.The advice to migrate was more in the general sense, rather than a workaround to this issue; little out there consumes
"esmodule", so it's just a dead entry in most situations.Edit: Also no reason to use
.cjs&.mjsat the same time. Your package is"type": "module", so can just use.jsfor the modern output.make-github-pseudonymous-again commented
on May 20, 2022 AuthorMore actionsOK!
Also no reason to use .cjs & .mjs at the same time. Your package is "type": "module", so can just use .js for the modern output.
I think I just wanted to avoid any chance of the running environment wrongly "guessing" the file format. But I guess no environment exists that understands
.mjsbut not the"type"key.
Here is what I get when running
v14.2.0:Here is what I get with
v15.0.0:These are the config files for
apiandcliSources can be found here.