Comparing version 1.0.0-alpha.4 to 1.0.0-alpha.5
@@ -11,2 +11,5 @@ import { exists, mkdir, unlink } from "node:fs/promises" | ||
// Get current architecture for build | ||
const arch = process.arch === 'arm64' ? 'arm64' : 'x86_64' | ||
// Bootstrap source should be in same directory as main | ||
@@ -42,3 +45,3 @@ const bootstrapSourcePath = mainModulePath.replace( | ||
{ | ||
architecture: process.arch, | ||
architecture: arch, | ||
handler: "bootstrap", | ||
@@ -108,3 +111,3 @@ maxDuration: 10, | ||
"--platform", | ||
`linux/${process.arch}`, | ||
`linux/${arch}`, | ||
"--rm", | ||
@@ -111,0 +114,0 @@ "-v", |
{ | ||
"name": "bun-vercel", | ||
"version": "1.0.0-alpha.4", | ||
"version": "1.0.0-alpha.5", | ||
"type": "module", | ||
@@ -9,3 +9,3 @@ "bin": { | ||
"devDependencies": { | ||
"bun-types": "^1.0.1", | ||
"bun-types": "^1.0.2", | ||
"prettier": "^3.0.3", | ||
@@ -12,0 +12,0 @@ "typescript": "^5.2.2" |
@@ -9,6 +9,29 @@ # bun-vercel | ||
```typescript | ||
// src/main.ts | ||
import { type Server } from "bun" | ||
export default { | ||
async fetch(request: Request, server: Server) { | ||
return new Response("Hello from Bun on Vercel", { | ||
status: 200, | ||
headers: { "Content-Type": "text/plain" } | ||
}) | ||
} | ||
} | ||
``` | ||
## Get Started | ||
#### 1. Update your package.json with `bun-vercel`: | ||
There are two ways to deploy your project to Vercel: | ||
1. GitHub integration | ||
2. Manually from your computer | ||
### GitHub Integration | ||
> Note: An issue in Bun must be resolved before this method is fully operational | ||
#### 1. Update your package.json with `bun-vercel` | ||
```json | ||
@@ -22,3 +45,3 @@ { | ||
#### 2. Update the `build` script run bun-vercel: | ||
#### 2. Update the `build` script run bun-vercel | ||
@@ -33,3 +56,3 @@ ```json | ||
#### 3. Add a `vercel.json` with your build command: | ||
#### 3. Add a `vercel.json` with your build command | ||
@@ -41,1 +64,11 @@ ```json | ||
``` | ||
### Manually | ||
Before starting you should follow the same setup steps as the GitHub integration, as they will be needed regardless. | ||
> Note: To deploy from your computer you must have Docker installed so we can build for Amazon Linux | ||
1. Install the Vercel CLI and run `vercel link` | ||
2. Run `bun run build` | ||
3. Run `vercel deploy --prebuilt --prod` |
Sorry, the diff of this file is not supported yet
17010
469
71