Closed juliusmarminge closed 7 months ago
Somewhat workaround:
import * as pkgJson from "../package.json";
export const version = pkgJson.version;
which generates
// .js
var version$1 = "1.0.0";
const version = version$1;
export { version };
// .d.ts
declare const version: string;
export { version };
Looks like because you put "module": "index.ts",
in the package.json and it's being picked up as ESM output, which breaks the code. I rewrote the exports handling and added a test in #470 , it looks good. Let's verify it with incoming release 🙏
Fixed in 5.0.0-beta.1
Repro: https://github.com/juliusmarminge/bunchee-export-pkgjson
generates the following d.ts files:
which is invalid:
I think it should be
?