mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 19:19:52 +02:00
feat: include sharp in build
This commit is contained in:
1 parent
379a33375d
commit
ee7ffe7bc8
3 files changed
+10
-7
No files matched your search
@@ -1,5 +1,8 @@
|
||||
import { build } from 'esbuild';
|
||||
import { cp, readdir } from 'fs/promises';
|
||||
import { argv } from 'process';
|
||||
|
||||
const isDev = argv.includes('--dev');
|
||||
|
||||
readdir('src/workers').then((workers) => {
|
||||
const files = [
|
||||
@@ -25,6 +28,7 @@ readdir('src/workers').then((workers) => {
|
||||
'.js': '.cjs',
|
||||
},
|
||||
|
||||
external: ['sharp'],
|
||||
bundle: true,
|
||||
sourcemap: true,
|
||||
minifyIdentifiers: false, // causes goofy errors
|
||||
@@ -42,3 +46,8 @@ readdir('node_modules/prisma').then((files) =>
|
||||
.filter((file) => file.endsWith('.node'))
|
||||
.map((file) => cp(`node_modules/prisma/${file}`, `dist/bot/${file}`)),
|
||||
);
|
||||
|
||||
// copy sharp as is
|
||||
if (!isDev) {
|
||||
cp('node_modules/sharp', 'dist/bot/node_modules/sharp', { recursive: true });
|
||||
}
|
||||
Reference in new issue
Block a user