Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@astrojs/vercel

Package Overview
Dependencies
Maintainers
4
Versions
211
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@astrojs/vercel - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

astrojs-vercel-0.1.2.tgz

6

CHANGELOG.md
# @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 @@

15

dist/index.js

@@ -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 @@ });

2

package.json
{
"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 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc