use web worker to run pglite

This commit is contained in:
duanfuxiang
2025-03-19 21:01:32 +08:00
parent 76288377c3
commit 679d7142eb
25 changed files with 985 additions and 461 deletions

View File

@@ -2,6 +2,7 @@ import path from 'path'
import esbuild from 'esbuild'
import process from 'process'
import builtins from 'builtin-modules'
import inlineWorkerPlugin from "esbuild-plugin-inline-worker";
const banner = `/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
@@ -17,7 +18,13 @@ const context = await esbuild.context({
},
entryPoints: ['src/main.ts'],
bundle: true,
plugins: [inlineWorkerPlugin({
define: {
'process': '{}', // 继承主配置
},
})],
external: [
'fs',
'obsidian',
'electron',
'@codemirror/autocomplete',