From 0280a3fe6164193df555aead1b551d03a5f4c925 Mon Sep 17 00:00:00 2001 From: Sumanth Chinthagunta Date: Sat, 16 Sep 2023 16:32:07 -0700 Subject: [PATCH] build(web): fix adapter --- apps/playground/svelte.config.js | 2 ++ apps/web/svelte.config.js | 20 ++++++++------------ docs/vercel.md | 3 ++- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/apps/playground/svelte.config.js b/apps/playground/svelte.config.js index f113d1ab..c5286f60 100644 --- a/apps/playground/svelte.config.js +++ b/apps/playground/svelte.config.js @@ -9,6 +9,8 @@ const config = { // for more information about preprocessors preprocess: [vitePreprocess()], + // The Svelte Inspector + // Usage: open up your project in the browser. Then use the key combo Command + Shift to activate vitePlugin: { inspector: true }, diff --git a/apps/web/svelte.config.js b/apps/web/svelte.config.js index 27b2a58a..d5c0116d 100644 --- a/apps/web/svelte.config.js +++ b/apps/web/svelte.config.js @@ -1,27 +1,24 @@ -import adapter from '@sveltejs/adapter-node'; -// import preprocess from 'svelte-preprocess'; +import adapterNode from '@sveltejs/adapter-node'; +import adapterAuto from '@sveltejs/adapter-auto'; import { vitePreprocess } from '@sveltejs/kit/vite'; -const isProd = process.env.NODE_ENV === 'production'; - /** @type {import('@sveltejs/kit').Config} */ const config = { + extensions: ['.svelte'], // Consult https://kit.svelte.dev/docs/integrations#preprocessors // for more information about preprocessors - preprocess: vitePreprocess(), + preprocess: [vitePreprocess()], // The Svelte Inspector // Usage: open up your project in the browser. Then use the key combo Command + Shift to activate vitePlugin: { inspector: true }, - kit: { - adapter: adapter({ - // HINT: need nodejs > v19 runtime - polyfill: false - }), - + // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. + // If your environment is not supported or you settled on a specific environment, switch out the adapter. + // See https://kit.svelte.dev/docs/adapters for more information about adapters. + adapter: process.env.VERCEL ? adapterAuto() : adapterNode({ polyfill: false }), // When hosting SPA on GitHub Pages paths: { // base: dev ? '' : '/hc360-ui', @@ -38,5 +35,4 @@ const config = { } } }; - export default config; diff --git a/docs/vercel.md b/docs/vercel.md index 918de139..d79ee392 100644 --- a/docs/vercel.md +++ b/docs/vercel.md @@ -1,6 +1,7 @@ # Vercel -![Vercel Monorepo](./images/monorepo.avif "Title") +![Vercel Monorepo](./images/monorepo.avif 'Title') +

The architecture of a monorepo deployed to Vercel

If your team uses a `trunk-based` development workflow and you want to deploy using `tags` and `releases`,