-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #392 from Secreto31126/Secreto31126-patch-1
Remove CJS native support
- Loading branch information
Showing
4 changed files
with
33 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,10 @@ | ||
/* eslint-disable tsdoc/syntax */ | ||
|
||
import { build } from "esbuild"; | ||
import { glob } from "glob"; | ||
import { writeFile } from "fs/promises"; | ||
|
||
/** | ||
* @type {import("esbuild").BuildOptions} | ||
*/ | ||
const sharedConfig = { | ||
await build({ | ||
entryPoints: await glob("src/**/*.ts", { ignore: ["src/standalone.ts"] }), | ||
sourcemap: true, | ||
platform: "node" | ||
}; | ||
|
||
await Promise.all([ | ||
// ESM | ||
build({ | ||
...sharedConfig, | ||
format: "esm", | ||
outdir: "lib/esm" | ||
}), | ||
|
||
// CJS | ||
build({ | ||
...sharedConfig, | ||
format: "cjs", | ||
outdir: "lib/cjs" | ||
}) | ||
]); | ||
|
||
await writeFile("./lib/cjs/package.json", '{"type":"commonjs"}'); | ||
platform: "node", | ||
format: "esm", | ||
outdir: "lib" | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters