aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/config/graphvizUMDVitePlugin.ts
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/config/graphvizUMDVitePlugin.ts')
-rw-r--r--subprojects/frontend/config/graphvizUMDVitePlugin.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/subprojects/frontend/config/graphvizUMDVitePlugin.ts b/subprojects/frontend/config/graphvizUMDVitePlugin.ts
index ab726e4f..0c3c9aa0 100644
--- a/subprojects/frontend/config/graphvizUMDVitePlugin.ts
+++ b/subprojects/frontend/config/graphvizUMDVitePlugin.ts
@@ -27,13 +27,15 @@ export default function graphvizUMDVitePlugin(): PluginOption {
27 async buildStart() { 27 async buildStart() {
28 const issuer = 28 const issuer =
29 root === undefined ? issuerFileName : path.join(root, issuerFileName); 29 root === undefined ? issuerFileName : path.join(root, issuerFileName);
30 const resolvedPath = pnpapi.resolveRequest( 30 // Since https://github.com/hpcc-systems/hpcc-js-wasm/commit/15e1ace5edae7f94714e547a3ac20e0e17cd6b0c,
31 '@hpcc-js/wasm/graphviz', 31 // hpcc-js has both a `.cjs` and a `.umd.js` build. PnPAPI will find the former, but we need the latter.
32 issuer, 32 const resolvedPath = pnpapi
33 ); 33 .resolveRequest('@hpcc-js/wasm/graphviz', issuer)
34 if (resolvedPath === null) { 34 ?.replace(/\.cjs$/, '.umd.js');
35 if (resolvedPath === undefined) {
35 return; 36 return;
36 } 37 }
38 console.log(resolvedPath);
37 if (command === 'serve') { 39 if (command === 'serve') {
38 url = `/@fs/${resolvedPath}`; 40 url = `/@fs/${resolvedPath}`;
39 } else { 41 } else {