From e6e19d74cdc1f74d7df20bd4fa7688514e2edd03 Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 12 Aug 2024 01:21:01 +0300 Subject: [PATCH] netlify-runtime --- app.config.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app.config.ts b/app.config.ts index 860366d2..c68206fa 100644 --- a/app.config.ts +++ b/app.config.ts @@ -6,9 +6,10 @@ import { PolyfillOptions, nodePolyfills } from 'vite-plugin-node-polyfills' import sassDts from 'vite-plugin-sass-dts' const isVercel = Boolean(process?.env.VERCEL) +const isNetlify = Boolean(process?.env.NETLIFY) const isBun = Boolean(process.env.BUN) - -console.info(`[app.config] build for ${isVercel ? 'vercel' : isBun ? 'bun' : 'node'}!`) +const runtime = isNetlify ? 'netlify' : isVercel ? 'vercel' : isBun ? 'bun' : 'node' +console.info(`[app.config] build for ${runtime}!`) const polyfillOptions = { include: ['path', 'stream', 'util'], @@ -25,7 +26,7 @@ const polyfillOptions = { export default defineConfig({ ssr: true, server: { - preset: isVercel ? 'vercel_edge' : isBun ? 'bun' : 'node', + preset: runtime, port: 3000, https: true },