fix(viewer): bundle published runtime dependencies
This commit is contained in:
1 parent
c77f5e1cec
commit
dfb507ffb3
2 files changed
+4
-4
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@wrnexus/viewer",
|
||||
"version": "0.8.13",
|
||||
"version": "0.8.14",
|
||||
"type": "module",
|
||||
"sideEffects": true,
|
||||
"description": "Read-only file previews with bounded loading and graceful fallback.",
|
||||
|
||||
@@ -52,7 +52,7 @@ function optionalRuntimes(): { id: string; entry: string; bundle?: boolean }[] {
|
||||
const runtimes: { id: string; entry: string; bundle?: boolean }[] = [];
|
||||
for (const item of OPTIONAL) {
|
||||
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
|
||||
// entry through a bundler breaks the worker handshake. Both files are already
|
||||
@@ -93,8 +93,8 @@ export function viewerPlugin(options: ViewerPluginOptions = {}) {
|
||||
name: "@wrnexus/viewer",
|
||||
componentDirs: [here("../components")],
|
||||
clientRuntimes: [
|
||||
{ id: "viewer-code", entry: here("./code-editor.ts") },
|
||||
{ id: "viewer", entry: here("./runtime.ts") },
|
||||
{ id: "viewer-code", entry: here("./code-editor.ts"), bundle: true },
|
||||
{ id: "viewer", entry: here("./runtime.ts"), bundle: true },
|
||||
...optionalRuntimes(),
|
||||
],
|
||||
styleSources: [{ id: "viewer", entry: here("../viewer.css") }],
|
||||
|
||||
Reference in new issue
Block a user