fix(viewer): bundle published runtime dependencies

This commit is contained in:
Clintchiz committed 2026-09-25 01:33:27 +05:30
1 parent c77f5e1cec
commit dfb507ffb3
2 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@wrnexus/viewer", "name": "@wrnexus/viewer",
"version": "0.8.13", "version": "0.8.14",
"type": "module", "type": "module",
"sideEffects": true, "sideEffects": true,
"description": "Read-only file previews with bounded loading and graceful fallback.", "description": "Read-only file previews with bounded loading and graceful fallback.",
+3 -3
View File
@@ -52,7 +52,7 @@ function optionalRuntimes(): { id: string; entry: string; bundle?: boolean }[] {
const runtimes: { id: string; entry: string; bundle?: boolean }[] = []; const runtimes: { id: string; entry: string; bundle?: boolean }[] = [];
for (const item of OPTIONAL) { for (const item of OPTIONAL) {
if (!resolves(item.package)) continue; if (!resolves(item.package)) continue;
runtimes.push({ id: item.id, entry: here(item.entry) }); runtimes.push({ id: item.id, entry: here(item.entry), bundle: true });
} }
// pdf.js is served from its own published build, not bundled: putting its ESM // pdf.js is served from its own published build, not bundled: putting its ESM
// entry through a bundler breaks the worker handshake. Both files are already // entry through a bundler breaks the worker handshake. Both files are already
@@ -93,8 +93,8 @@ export function viewerPlugin(options: ViewerPluginOptions = {}) {
name: "@wrnexus/viewer", name: "@wrnexus/viewer",
componentDirs: [here("../components")], componentDirs: [here("../components")],
clientRuntimes: [ clientRuntimes: [
{ id: "viewer-code", entry: here("./code-editor.ts") }, { id: "viewer-code", entry: here("./code-editor.ts"), bundle: true },
{ id: "viewer", entry: here("./runtime.ts") }, { id: "viewer", entry: here("./runtime.ts"), bundle: true },
...optionalRuntimes(), ...optionalRuntimes(),
], ],
styleSources: [{ id: "viewer", entry: here("../viewer.css") }], styleSources: [{ id: "viewer", entry: here("../viewer.css") }],