mirror of https://github.com/buster-so/buster.git
update build command for vercel
This commit is contained in:
parent
e63fdfba47
commit
7b98cd2ed7
|
@ -6,6 +6,8 @@
|
|||
"scripts": {
|
||||
"prebuild": "tsx scripts/validate-env.ts",
|
||||
"build:vercel": "pnpm prebuild && cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build -- --typecheck",
|
||||
"build:vercel:staging": "pnpm prebuild && cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode staging -- --typecheck",
|
||||
"build:vercel:production": "pnpm prebuild && cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode production -- --typecheck",
|
||||
"build": "pnpm build:local",
|
||||
"build:staging": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm run prebuild && vite build --mode staging -- --typecheck",
|
||||
"build:production": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm run prebuild && vite build --mode production -- --typecheck",
|
||||
|
|
|
@ -16,6 +16,20 @@
|
|||
],
|
||||
"outputs": [".output/**", ".vercel/**"]
|
||||
},
|
||||
"build:vercel": {
|
||||
"dependsOn": ["^build:vercel", "@buster/server-shared#build"],
|
||||
"inputs": [
|
||||
"src/**/*",
|
||||
"!src/**/*.test.{ts,tsx,js,jsx}",
|
||||
"!src/**/*.spec.{ts,tsx,js,jsx}",
|
||||
"public/**/*",
|
||||
"next.config.mjs",
|
||||
"tailwind.config.ts",
|
||||
"tsconfig.json",
|
||||
"package.json"
|
||||
],
|
||||
"outputs": [".output/**", ".vercel/**"]
|
||||
},
|
||||
"start": {
|
||||
"dependsOn": ["build"],
|
||||
"cache": true,
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
"buildCommand": "pnpm build:vercel",
|
||||
"outputDirectory": ".output/public",
|
||||
"headers": [
|
||||
{
|
||||
"source": "/assets/(.*)",
|
||||
|
|
|
@ -14,7 +14,13 @@ const config = defineConfig(({ command, mode }) => {
|
|||
const isTypecheck = process.argv.includes('--typecheck') || process.env.TYPECHECK === 'true';
|
||||
const useChecker = !process.env.VITEST && isBuild;
|
||||
const isLocalBuild = process.argv.includes('--local') || mode === 'development';
|
||||
const target = isLocalBuild ? ('bun' as const) : ('vercel' as const);
|
||||
const isVercelBuild = process.env.VERCEL === '1' || process.env.CI === '1';
|
||||
console.log('isVercelBuild', isVercelBuild, process.env.VERCEL, process.env.CI);
|
||||
const target = isLocalBuild
|
||||
? ('bun' as const)
|
||||
: isVercelBuild
|
||||
? ('vercel' as const)
|
||||
: ('bun' as const);
|
||||
|
||||
// Generate a unique version identifier for both build tracking and asset versioning
|
||||
const buildId =
|
||||
|
|
Loading…
Reference in New Issue