mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 19:19:52 +02:00
feat: simplified build script
This commit is contained in:
1 parent
38f912dc0a
commit
876fb0fc5e
4 files changed
+39
-40
No files matched your search
@@ -1,35 +0,0 @@
|
||||
import { build } from 'esbuild';
|
||||
import { argv } from 'process';
|
||||
|
||||
const targetFile = argv
|
||||
.find((arg) => arg.startsWith('--build='))
|
||||
?.split('=')[1];
|
||||
const files = targetFile ? [targetFile] : ['bot', 'server'];
|
||||
|
||||
files.forEach(async (file) => {
|
||||
console.log(`Building ${file}...`);
|
||||
|
||||
await build({
|
||||
entryPoints: [`src/${file}.ts`],
|
||||
outfile: `dist/${file}/index.cjs`,
|
||||
|
||||
platform: 'node',
|
||||
tsconfig: 'tsconfig.esbuild.json',
|
||||
loader: {
|
||||
'.node': 'copy',
|
||||
'.ttf': 'file',
|
||||
},
|
||||
format: 'cjs',
|
||||
jsx: 'transform',
|
||||
|
||||
bundle: true,
|
||||
sourcemap: true,
|
||||
minifyIdentifiers: false, // cause goofy errors
|
||||
minifySyntax: true,
|
||||
minifyWhitespace: true,
|
||||
|
||||
logLevel: 'info',
|
||||
});
|
||||
|
||||
console.log(`Built ${file}`);
|
||||
});
|
||||
@@ -0,0 +1,27 @@
|
||||
import { build } from 'esbuild';
|
||||
|
||||
console.log('Building bot...');
|
||||
|
||||
await build({
|
||||
entryPoints: ['src/bot.ts'],
|
||||
outfile: 'dist/bot/index.cjs',
|
||||
|
||||
platform: 'node',
|
||||
tsconfig: 'tsconfig.esbuild.json',
|
||||
loader: {
|
||||
'.node': 'copy',
|
||||
'.ttf': 'file',
|
||||
},
|
||||
format: 'cjs',
|
||||
jsx: 'transform',
|
||||
|
||||
bundle: true,
|
||||
sourcemap: true,
|
||||
minifyIdentifiers: false, // cause goofy errors
|
||||
minifySyntax: true,
|
||||
minifyWhitespace: true,
|
||||
|
||||
logLevel: 'info',
|
||||
});
|
||||
|
||||
console.log('Built bot');
|
||||
Reference in new issue
Block a user