From 05a43861d1b39038fe1b695a5b1901df5d503306 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Fri, 22 Nov 2024 14:08:04 -0800 Subject: [PATCH] build: externalize non-esm deps in ssr build (#10848) ## Summary We need to set Vite's `ssr.noExternal` option to the same non-ESM dependencies we add to Lumina's `bundleIn` option. This also removes calcite-component's `test:prerender` NPM script, which does a Vite SSR build and is no longer necessary after migrating to Lumina. ref: --- packages/calcite-components/package.json | 2 -- packages/calcite-components/vite.config.ts | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/calcite-components/package.json b/packages/calcite-components/package.json index eb0ac5a48b4..17ae7e15d03 100644 --- a/packages/calcite-components/package.json +++ b/packages/calcite-components/package.json @@ -53,8 +53,6 @@ "screenshot-tests:publish": "npm run screenshot-tests && storybook-to-ghpages --existing-output-dir=docs", "start": "npm run util:clean-js-files && concurrently --kill-others --raw \"tsc --project ./tsconfig-demos.json --watch\" \"npm run build:watch-dev\"", "test": "vitest run", - "posttest": "npm run test:prerender", - "test:prerender": "vite build --ssr", "test:watch": "vitest", "util:clean-js-files": "rimraf --glob -- *.js {src,.storybook,support}/**.js", "util:clean-readmes": "git restore src/components/*/readme.md", diff --git a/packages/calcite-components/vite.config.ts b/packages/calcite-components/vite.config.ts index c8b4225bb59..6e49b132198 100644 --- a/packages/calcite-components/vite.config.ts +++ b/packages/calcite-components/vite.config.ts @@ -12,6 +12,10 @@ import tailwindConfig from "./tailwind.config"; const nonEsmDependencies = ["color", "interactjs"]; export default defineConfig({ + ssr: { + noExternal: nonEsmDependencies, + }, + plugins: [ useLumina({ build: {