mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
lazy import code editor once, externalized codemirror
This commit is contained in:
17
app/build.ts
17
app/build.ts
@@ -72,16 +72,12 @@ await tsup.build({
|
||||
/**
|
||||
* Building UI for direct imports
|
||||
*/
|
||||
const ui_splitting = false;
|
||||
await tsup.build({
|
||||
minify,
|
||||
sourcemap,
|
||||
watch,
|
||||
entry: [
|
||||
"src/ui/index.ts",
|
||||
"src/ui/client/index.ts",
|
||||
"src/ui/elements/index.ts",
|
||||
"src/ui/main.css"
|
||||
],
|
||||
entry: ["src/ui/index.ts", "src/ui/client/index.ts", "src/ui/main.css"],
|
||||
outDir: "dist/ui",
|
||||
external: [
|
||||
"bun:test",
|
||||
@@ -89,19 +85,22 @@ await tsup.build({
|
||||
"react-dom",
|
||||
"react/jsx-runtime",
|
||||
"react/jsx-dev-runtime",
|
||||
"use-sync-external-store"
|
||||
"use-sync-external-store",
|
||||
/codemirror/
|
||||
],
|
||||
metafile: true,
|
||||
platform: "browser",
|
||||
format: ["esm"],
|
||||
splitting: true,
|
||||
splitting: ui_splitting,
|
||||
treeshake: true,
|
||||
loader: {
|
||||
".svg": "dataurl"
|
||||
},
|
||||
esbuildOptions: (options) => {
|
||||
options.logLevel = "silent";
|
||||
options.chunkNames = "chunks/[name]-[hash]";
|
||||
if (ui_splitting) {
|
||||
options.chunkNames = "chunks/[name]-[hash]";
|
||||
}
|
||||
},
|
||||
onSuccess: async () => {
|
||||
delayTypes();
|
||||
|
||||
Reference in New Issue
Block a user