From e4defe5467267390a1d085bc72cfb875d5e64b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gautier=20Ben=20A=C3=AFm?= Date: Tue, 4 Mar 2025 15:43:18 +0100 Subject: [PATCH] fix(vite-plugin): vite should bundle all dependencies in ssr mode (closes #141) --- vite-plugin/src/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vite-plugin/src/index.ts b/vite-plugin/src/index.ts index 17309651..35e120f6 100644 --- a/vite-plugin/src/index.ts +++ b/vite-plugin/src/index.ts @@ -122,13 +122,15 @@ export default function jahia( */ config(config) { // Mutate the configuration to set base settings if they are not already set - // Build all environments https://vite.dev/guide/api-environment-frameworks.html#environments-during-build - config.builder ??= { sharedConfigBuild: true }; - // Enable the modern JSX runtime config.esbuild ??= { jsx: "automatic" }; return { + // Build all environments https://vite.dev/guide/api-environment-frameworks.html#environments-during-build + builder: { sharedConfigBuild: true }, + // Enforce bundling of all dependencies + ssr: { noExternal: true }, + // Define the environments (client and ssr) environments: { client: { build: {