Fix ES imports for webpack: declare exports.browser entrypoint as higher priority than import

We could also drop the browser's directive `"./dist/node/openpgp.min.cjs": "./dist/openpgp.min.js"`,
since that build cannot be used with `require()`, and it's instead meant
to be the target of <script> tags.
But we keep it around for now to avoid potentially breaking changes, in case it's
used in some setups.
This commit is contained in:
larabr 2024-11-21 14:50:46 +01:00
parent 121b478312
commit f75447afaa

View File

@ -22,9 +22,9 @@
"exports": { "exports": {
".": { ".": {
"types": "./openpgp.d.ts", "types": "./openpgp.d.ts",
"browser": "./dist/openpgp.min.mjs",
"import": "./dist/node/openpgp.mjs", "import": "./dist/node/openpgp.mjs",
"require": "./dist/node/openpgp.min.cjs", "require": "./dist/node/openpgp.min.cjs"
"browser": "./dist/openpgp.min.mjs"
}, },
"./lightweight": { "./lightweight": {
"types": "./openpgp.d.ts", "types": "./openpgp.d.ts",