-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): use esbuild instead of tsc
Replace the tsc command with esbuild package to optimize our build process as well as overall package Fix #4 Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
- Loading branch information
1 parent
cf727b3
commit d9a17c0
Showing
4 changed files
with
176 additions
and
20 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,32 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const esbuild = require('esbuild'); | ||
|
||
// Build for ESM | ||
esbuild | ||
.build({ | ||
logLevel: 'info', | ||
entryPoints: ['src/index.ts'], | ||
outdir: 'dist/esm', | ||
platform: 'node', | ||
bundle: true, | ||
sourcemap: false, | ||
minify: true, | ||
splitting: true, | ||
format: 'esm', | ||
target: ['ESNext'], | ||
}) | ||
.catch(() => process.exit(1)); | ||
|
||
// Build for CJS | ||
esbuild | ||
.build({ | ||
logLevel: 'info', | ||
entryPoints: ['src/index.ts', 'src/generate.ts'], | ||
outdir: 'dist/cjs', | ||
platform: 'node', | ||
bundle: true, | ||
sourcemap: false, | ||
minify: true, | ||
format: 'cjs', | ||
}) | ||
.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
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