-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add esbuild script for esm / commonjs shared builds
Signed-off-by: Ian Bolton <[email protected]>
- Loading branch information
1 parent
998abb6
commit be715f2
Showing
3 changed files
with
35 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import esbuild from "esbuild"; | ||
|
||
esbuild | ||
.build({ | ||
entryPoints: ["src/index.ts"], | ||
bundle: true, | ||
platform: "node", | ||
sourcemap: true, | ||
outdir: "dist", | ||
format: "esm", | ||
target: "esnext", | ||
splitting: true, | ||
outExtension: { ".js": ".esm.js" }, | ||
}) | ||
.catch(() => process.exit(1)); | ||
|
||
esbuild | ||
.build({ | ||
entryPoints: ["src/index.ts"], | ||
bundle: true, | ||
platform: "node", | ||
sourcemap: true, | ||
outdir: "dist", | ||
format: "cjs", | ||
target: "es2015", | ||
outExtension: { ".js": ".cjs.js" }, | ||
}) | ||
.catch(() => process.exit(1)); |
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