chore: optimize onnxruntime-node

This commit is contained in:
ShareVB committed 2025-05-13 23:45:39 +02:00
1 parent 8de053540a
commit 99f4f830bb
1 file changed
+3 -2
+3 -2
View File
@@ -115,6 +115,7 @@ export default defineConfig({
'fs': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)), 'fs': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
'@babel/core': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)), '@babel/core': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
'isolated-vm': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)), 'isolated-vm': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
'onnxruntime-node': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
}, },
}, },
define: { define: {
@@ -131,7 +132,7 @@ export default defineConfig({
// cssMinify: false, // cssMinify: false,
modulePreload: false, modulePreload: false,
rollupOptions: { rollupOptions: {
external: ['regex', './out/isolated_vm', 'isolated-vm'], external: ['regex', './out/isolated_vm', 'isolated-vm', 'onnxruntime-node'],
output: { output: {
format: 'es', format: 'es',
manualChunks: (id) => { manualChunks: (id) => {
@@ -153,7 +154,7 @@ export default defineConfig({
}, },
}, },
optimizeDeps: { optimizeDeps: {
include: ['isolated-vm', 'pdfjs-dist'], // optionally specify dependency name include: ['isolated-vm', 'pdfjs-dist', 'onnxruntime-node'], // optionally specify dependency name
esbuildOptions: { esbuildOptions: {
supported: { supported: {
'top-level-await': true, 'top-level-await': true,