netlify-runtime
This commit is contained in:
parent
6a105b24fc
commit
e6e19d74cd
|
@ -6,9 +6,10 @@ import { PolyfillOptions, nodePolyfills } from 'vite-plugin-node-polyfills'
|
||||||
import sassDts from 'vite-plugin-sass-dts'
|
import sassDts from 'vite-plugin-sass-dts'
|
||||||
|
|
||||||
const isVercel = Boolean(process?.env.VERCEL)
|
const isVercel = Boolean(process?.env.VERCEL)
|
||||||
|
const isNetlify = Boolean(process?.env.NETLIFY)
|
||||||
const isBun = Boolean(process.env.BUN)
|
const isBun = Boolean(process.env.BUN)
|
||||||
|
const runtime = isNetlify ? 'netlify' : isVercel ? 'vercel' : isBun ? 'bun' : 'node'
|
||||||
console.info(`[app.config] build for ${isVercel ? 'vercel' : isBun ? 'bun' : 'node'}!`)
|
console.info(`[app.config] build for ${runtime}!`)
|
||||||
|
|
||||||
const polyfillOptions = {
|
const polyfillOptions = {
|
||||||
include: ['path', 'stream', 'util'],
|
include: ['path', 'stream', 'util'],
|
||||||
|
@ -25,7 +26,7 @@ const polyfillOptions = {
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
ssr: true,
|
ssr: true,
|
||||||
server: {
|
server: {
|
||||||
preset: isVercel ? 'vercel_edge' : isBun ? 'bun' : 'node',
|
preset: runtime,
|
||||||
port: 3000,
|
port: 3000,
|
||||||
https: true
|
https: true
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user