When package.json is generated, the conditional exports are in the wrong order: "default" must be the last one.
The example is from https://github.com/atomicojs/hooks. Here is what is generated:
{
"exports": {
".": {
"default": "./dist/index.js",
"types": "./dist/index.d.ts"
}
}
}
Here is what is expected instead:
{
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
This is a problem because webpack crashes if the default doesn't come last: https://github.com/webpack/enhanced-resolve/blob/v5.15.0/lib/util/entrypoints.js#L475.
When package.json is generated, the conditional exports are in the wrong order: "default" must be the last one.
The example is from https://github.com/atomicojs/hooks. Here is what is generated:
{ "exports": { ".": { "default": "./dist/index.js", "types": "./dist/index.d.ts" } } }Here is what is expected instead:
{ "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } } }This is a problem because webpack crashes if the default doesn't come last: https://github.com/webpack/enhanced-resolve/blob/v5.15.0/lib/util/entrypoints.js#L475.