ποΈBuild configuration
Bundling a microservice
const { build } = require('esbuild')
const [entryPointArg, outfileArg] = process.argv.slice(2)
// if no arguments, by default bundle the 'main.ts' file
const entryPoint = entryPointArg ?? 'main'
const outfile = outfileArg ?? 'main'
build({
entryPoints: [`src/${entryPoint}.ts`],
outfile: `dist/${outfile ?? entryPoint}.js`,
bundle: true,
platform: 'node',
logLevel: 'info',
}).catch(() => process.exit(1))Building a project
Last updated