25 lines
437 B
JavaScript
25 lines
437 B
JavaScript
import { build } from 'esbuild';
|
|
import { join } from 'path';
|
|
|
|
const root = process.cwd();
|
|
|
|
build({
|
|
bundle: true,
|
|
entryPoints: [
|
|
join(root, 'out/src/index.js'),
|
|
],
|
|
format: 'cjs',
|
|
keepNames: true,
|
|
loader: {
|
|
'.yml': 'text',
|
|
},
|
|
outdir: 'out/bundle/',
|
|
outExtension: {
|
|
'.js': '.cjs',
|
|
},
|
|
platform: 'node',
|
|
}).catch((err) => {
|
|
console.error(err);
|
|
process.exit(1);
|
|
});
|