@astrojs/vercel
Advanced tools
Comparing version 0.1.1 to 0.1.2
# @astrojs/vercel | ||
## 0.1.2 | ||
### Patch Changes | ||
- [#3081](https://github.com/withastro/astro/pull/3081) [`f665d1a2`](https://github.com/withastro/astro/commit/f665d1a250ef34a9d1cbced9e4441c7e2dc246b8) Thanks [@JuanM04](https://github.com/JuanM04)! - Support dynamic paths | ||
## 0.1.1 | ||
@@ -4,0 +10,0 @@ |
@@ -44,2 +44,10 @@ import fs from "fs/promises"; | ||
await fs.rm(tmpDir, { recursive: true }); | ||
let staticRoutes = []; | ||
let dynamicRoutes = []; | ||
for (const route of routes) { | ||
if (route.params.length === 0) | ||
staticRoutes.push(route); | ||
else | ||
dynamicRoutes.push(route); | ||
} | ||
await writeJson(new URL(`./routes-manifest.json`, _config.outDir), { | ||
@@ -49,5 +57,10 @@ version: 3, | ||
pages404: false, | ||
rewrites: routes.map((route) => ({ | ||
rewrites: staticRoutes.map((route) => ({ | ||
source: route.pathname, | ||
regex: route.pattern.toString(), | ||
destination: `/${ENTRYFILE}` | ||
})), | ||
dynamicRoutes: dynamicRoutes.map((route) => ({ | ||
page: `/${ENTRYFILE}`, | ||
regex: route.pattern.toString() | ||
})) | ||
@@ -54,0 +67,0 @@ }); |
{ | ||
"name": "@astrojs/vercel", | ||
"description": "Deploy your site to Vercel", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "types": "./dist/index.d.ts", |
@@ -1,2 +0,2 @@ | ||
import type { AstroAdapter, AstroConfig, AstroIntegration } from 'astro'; | ||
import type { AstroAdapter, AstroConfig, AstroIntegration, RouteData } from 'astro'; | ||
import type { PathLike } from 'fs'; | ||
@@ -70,2 +70,10 @@ import fs from 'fs/promises'; | ||
let staticRoutes: RouteData[] = []; | ||
let dynamicRoutes: RouteData[] = []; | ||
for (const route of routes) { | ||
if (route.params.length === 0) staticRoutes.push(route); | ||
else dynamicRoutes.push(route); | ||
} | ||
// Routes Manifest | ||
@@ -77,6 +85,11 @@ // https://vercel.com/docs/file-system-api#configuration/routes | ||
pages404: false, | ||
rewrites: routes.map((route) => ({ | ||
rewrites: staticRoutes.map((route) => ({ | ||
source: route.pathname, | ||
regex: route.pattern.toString(), | ||
destination: `/${ENTRYFILE}`, | ||
})), | ||
dynamicRoutes: dynamicRoutes.map((route) => ({ | ||
page: `/${ENTRYFILE}`, | ||
regex: route.pattern.toString(), | ||
})), | ||
}); | ||
@@ -83,0 +96,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
22480
384