diff --git a/.changeset/fair-phones-sniff.md b/.changeset/fair-phones-sniff.md new file mode 100644 index 00000000..4b0c2f31 --- /dev/null +++ b/.changeset/fair-phones-sniff.md @@ -0,0 +1,5 @@ +--- +"vinxi": patch +--- + +fix: transpile deps that begin with @vinxi/* diff --git a/packages/vinxi/lib/build.js b/packages/vinxi/lib/build.js index e9369ec7..e3562980 100644 --- a/packages/vinxi/lib/build.js +++ b/packages/vinxi/lib/build.js @@ -1,4 +1,4 @@ -import { mkdir, rm, writeFile } from "fs/promises"; +import { mkdir, rm } from "fs/promises"; import { createRequire } from "module"; import { build, copyPublicAssets, createNitro, prerender } from "nitropack"; @@ -524,7 +524,8 @@ const routerModePlugin = { config("appType", { appType: "custom", ssr: { - noExternal: ["vinxi"], + noExternal: ["vinxi", /@vinxi\//], + external: ["@vinxi/listhen"], }, build: { rollupOptions: { @@ -567,7 +568,8 @@ const routerModePlugin = { config("appType", { appType: "custom", ssr: { - noExternal: ["vinxi"], + noExternal: ["vinxi", /@vinxi\//], + external: ["@vinxi/listhen"], }, build: { rollupOptions: { @@ -607,7 +609,8 @@ const routerModePlugin = { config("appType", { appType: "custom", ssr: { - noExternal: ["vinxi"], + noExternal: ["vinxi", /@vinxi\//], + external: ["@vinxi/listhen"], }, build: { rollupOptions: { diff --git a/packages/vinxi/lib/router-dev-plugins.js b/packages/vinxi/lib/router-dev-plugins.js index 28b6c99e..a79f2586 100644 --- a/packages/vinxi/lib/router-dev-plugins.js +++ b/packages/vinxi/lib/router-dev-plugins.js @@ -18,7 +18,7 @@ export const ROUTER_MODE_DEV_PLUGINS = { config("appType", { appType: "spa", ssr: { - noExternal: ["vinxi"], + noExternal: ["vinxi", /@vinxi\//], }, cacheDir: `node_modules/.vinxi/cache/${router.name}`, optimizeDeps: { @@ -62,7 +62,7 @@ export const ROUTER_MODE_DEV_PLUGINS = { config("appType", { appType: "custom", ssr: { - noExternal: ["vinxi"], + noExternal: ["vinxi", /@vinxi\//], }, cacheDir: `node_modules/.vinxi/cache/${router.name}`, define: { @@ -103,7 +103,7 @@ export const ROUTER_MODE_DEV_PLUGINS = { appType: "custom", cacheDir: `node_modules/.vinxi/cache/${router.name}`, ssr: { - noExternal: ["vinxi"], + noExternal: ["vinxi", /@vinxi\//], }, optimizeDeps: { exclude: ["vinxi"],