From 5a7d0fd4d1fa2f23c435f2542d198c60c1a1d5b5 Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Sun, 23 Apr 2023 08:51:24 +0800 Subject: [PATCH] Update pridepack config Only load wasm module for CJS builds. --- examples/cli/pridepack.config.js | 16 +++++++++++----- examples/cli/src/packages/@modal-sh/mio-ai | 1 - 2 files changed, 11 insertions(+), 6 deletions(-) delete mode 120000 examples/cli/src/packages/@modal-sh/mio-ai diff --git a/examples/cli/pridepack.config.js b/examples/cli/pridepack.config.js index 9d9273d..0715fcb 100644 --- a/examples/cli/pridepack.config.js +++ b/examples/cli/pridepack.config.js @@ -1,9 +1,15 @@ const { wasmLoader } = require('esbuild-plugin-wasm'); module.exports = { target: 'esnext', - plugins: () => [ - wasmLoader({ - mode: 'deferred', - }), - ], + plugins: ({ isCJS }) => { + if (isCJS) { + return [ + wasmLoader({ + mode: 'deferred', + }), + ]; + } + + return []; + }, } diff --git a/examples/cli/src/packages/@modal-sh/mio-ai b/examples/cli/src/packages/@modal-sh/mio-ai deleted file mode 120000 index 3efed95..0000000 --- a/examples/cli/src/packages/@modal-sh/mio-ai +++ /dev/null @@ -1 +0,0 @@ -../../../../../ \ No newline at end of file