zipline/esbuild.config.js

41 lines
1 KiB
JavaScript
Raw Normal View History

const esbuild = require('esbuild');
2022-03-13 21:30:37 -05:00
const { existsSync } = require('fs');
const { rm } = require('fs/promises');
(async () => {
const watch = process.argv[2] === '--watch';
2022-03-13 21:30:37 -05:00
if (existsSync('./dist')) {
await rm('./dist', { recursive: true });
}
await esbuild.build({
tsconfig: 'tsconfig.json',
outdir: 'dist',
bundle: false,
platform: 'node',
treeShaking: true,
entryPoints: [
'src/server/index.ts',
'src/server/util.ts',
'src/lib/logger.ts',
2022-06-20 12:55:43 -05:00
'src/lib/config.ts',
'src/lib/config/Config.ts',
'src/lib/config/readConfig.ts',
'src/lib/config/validateConfig.ts',
2022-06-20 12:25:22 -05:00
'src/lib/datasources/Datasource.ts',
'src/lib/datasources/index.ts',
'src/lib/datasources/Local.ts',
'src/lib/datasources/S3.ts',
'src/lib/datasources/Swift.ts',
2022-06-20 12:25:22 -05:00
'src/lib/datasource.ts',
],
format: 'cjs',
resolveExtensions: ['.ts', '.js'],
write: true,
watch,
incremental: watch,
sourcemap: false,
2022-06-20 19:09:52 -05:00
minify: true,
});
})();