mirror of
https://github.com/luxdao/zodiac.git
synced 2026-10-30 20:34:38 +00:00
12 lines
493 B
JavaScript
12 lines
493 B
JavaScript
import { writeFileSync } from "node:fs";
|
|
|
|
// The package root is `"type": "module"`, so every `.js` is treated as ESM by
|
|
// default. The CJS build emits CommonJS (`require`/`module.exports`), so its
|
|
// folder needs its own `package.json` flipping the type back to commonjs.
|
|
// The ESM marker is redundant but explicit.
|
|
writeFileSync("dist/esm/package.json", JSON.stringify({ type: "module" }) + "\n");
|
|
writeFileSync(
|
|
"dist/cjs/package.json",
|
|
JSON.stringify({ type: "commonjs" }) + "\n"
|
|
);
|