chore: add Vercel build configuration
- Introduced a new build script for Vercel in package.json. - Created a new tsdown configuration file for Vercel deployment. - Updated tsconfig.json to remove the deprecated vercel.ts file from the include path. - Added a new server entry point for compatibility with Vercel's deployment.
This commit is contained in:
parent
bef0e52883
commit
20b67e1402
|
|
@ -0,0 +1,5 @@
|
|||
// This file is for compatibility with Vercel's deployment.
|
||||
|
||||
import '@/utils/request-rewriter';
|
||||
|
||||
export default (await import('./app-bootstrap')).default;
|
||||
|
|
@ -22,6 +22,7 @@
|
|||
],
|
||||
"scripts": {
|
||||
"build": "tsx scripts/workflow/build-routes.ts && tsdown",
|
||||
"build:vercel": "tsx scripts/workflow/build-routes.ts && tsdown --config ./tsdown-vercel.config.ts",
|
||||
"build:docs": "tsx scripts/workflow/build-docs.ts",
|
||||
"dev": "cross-env NODE_ENV=dev tsx watch --inspect --clear-screen=false lib/index.ts",
|
||||
"dev:cache": "cross-env NODE_ENV=production tsx watch --clear-screen=false lib/index.ts",
|
||||
|
|
|
|||
|
|
@ -18,6 +18,6 @@
|
|||
"resolveJsonModule": true,
|
||||
"isolatedModules": true
|
||||
},
|
||||
"include": ["./lib/**/*", "./api/vercel.ts"],
|
||||
"include": ["./lib/**/*"],
|
||||
"exclude": ["node_modules", "*.test.*"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
import { defineConfig } from 'tsdown';
|
||||
import artTemplatesPlugin from './plugins/rollup-plugin-art-templates.ts';
|
||||
|
||||
export default defineConfig({
|
||||
entry: ['./lib/server.ts'],
|
||||
minify: true,
|
||||
shims: true,
|
||||
clean: true,
|
||||
plugins: [artTemplatesPlugin()],
|
||||
});
|
||||
|
|
@ -1,5 +1,9 @@
|
|||
{
|
||||
"$schema": "https://openapi.vercel.sh/vercel.json",
|
||||
"framework": "hono",
|
||||
"github": { "silent": true },
|
||||
"routes": [{ "src": "/.*", "dest": "/api/vercel.ts" }]
|
||||
"buildCommand": "pnpm run build:vercel",
|
||||
"outputDirectory": "dist",
|
||||
"github": {
|
||||
"silent": true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue