-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
adfb33a
commit bf8567e
Showing
25 changed files
with
700 additions
and
1,144 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
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 was deleted.
Oops, something went wrong.
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,44 @@ | ||
import glob from 'fast-glob'; | ||
import esbuild from 'esbuild'; | ||
import { nodeExternalsPlugin } from 'esbuild-node-externals'; | ||
|
||
const args = process.argv.slice(2); | ||
const watchEnabled = args[0] === 'watch'; | ||
const packageName = process.env.npm_package_name; | ||
|
||
try { | ||
const context = await esbuild.context({ | ||
entryPoints: glob.sync(['src/**/*.ts?(x)', 'src/*.ts?(x)'], { | ||
ignore: ['**/__tests__', 'src/labs'] | ||
}), | ||
outdir: './dist', | ||
outExtension: { '.js': '.mjs' }, | ||
bundle: true, | ||
sourcemap: false, | ||
splitting: true, | ||
minify: true, | ||
format: 'esm', | ||
target: ['es2022', 'node18'], | ||
platform: 'node', | ||
plugins: [nodeExternalsPlugin()] | ||
}); | ||
await context.rebuild(); | ||
if (watchEnabled) { | ||
await context.watch(); | ||
} | ||
await context.serve(); | ||
context.dispose(); | ||
} catch (e) { | ||
if (e.errors && e.errors.length > 0) { | ||
console.group(`!!!!!!! ${packageName} build errors !!!!!!!`); | ||
console.error(e.errors); | ||
console.groupEnd(); | ||
} | ||
|
||
if (e.warnings && e.warnings.length > 0) { | ||
console.group(`!!!!!!! ${packageName} build warnings !!!!!!!`); | ||
console.error(e.warnings); | ||
console.groupEnd(); | ||
} | ||
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
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.