Skip to content

Commit

Permalink
build: externalize non-esm deps in ssr build (#10848)
Browse files Browse the repository at this point in the history
## 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: <https://vite.dev/guide/ssr#ssr-externals>
  • Loading branch information
benelan authored Nov 22, 2024
1 parent 98f1e17 commit 05a4386
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions packages/calcite-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/calcite-components/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import tailwindConfig from "./tailwind.config";
const nonEsmDependencies = ["color", "interactjs"];

export default defineConfig({
ssr: {
noExternal: nonEsmDependencies,
},

plugins: [
useLumina({
build: {
Expand Down

0 comments on commit 05a4386

Please sign in to comment.