@astrojs/vercel
Advanced tools
Comparing version 2.3.3 to 2.3.4
# @astrojs/vercel | ||
## 2.3.4 | ||
### Patch Changes | ||
- [#5361](https://github.com/withastro/astro/pull/5361) [`ee750087c`](https://github.com/withastro/astro/commit/ee750087ce360c54d349f160d84bbdafb0ec83b4) Thanks [@matthewp](https://github.com/matthewp)! - Allows @astrojs/image to be used in Vercel SSR | ||
## 2.3.3 | ||
@@ -4,0 +10,0 @@ |
@@ -0,1 +1,3 @@ | ||
import glob from "fast-glob"; | ||
import { pathToFileURL } from "url"; | ||
import { getVercelOutput, removeDir, writeJson } from "../lib/fs.js"; | ||
@@ -57,6 +59,20 @@ import { copyDependenciesToFunction } from "../lib/nft.js"; | ||
"astro:build:done": async ({ routes }) => { | ||
const inc = (includeFiles == null ? void 0 : includeFiles.map((file) => new URL(file, _config.root))) || []; | ||
if (_config.vite.assetsInclude) { | ||
const mergeGlobbedIncludes = (globPattern) => { | ||
if (typeof globPattern === "string") { | ||
const entries = glob.sync(globPattern).map((p) => pathToFileURL(p)); | ||
inc.push(...entries); | ||
} else if (Array.isArray(globPattern)) { | ||
for (const pattern of globPattern) { | ||
mergeGlobbedIncludes(pattern); | ||
} | ||
} | ||
}; | ||
mergeGlobbedIncludes(_config.vite.assetsInclude); | ||
} | ||
const { handler } = await copyDependenciesToFunction({ | ||
entry: new URL(serverEntry, buildTempFolder), | ||
outDir: functionFolder, | ||
includeFiles: (includeFiles == null ? void 0 : includeFiles.map((file) => new URL(file, _config.root))) || [], | ||
includeFiles: inc, | ||
excludeFiles: (excludeFiles == null ? void 0 : excludeFiles.map((file) => new URL(file, _config.root))) || [] | ||
@@ -63,0 +79,0 @@ }); |
{ | ||
"name": "@astrojs/vercel", | ||
"description": "Deploy your site to Vercel", | ||
"version": "2.3.3", | ||
"version": "2.3.4", | ||
"type": "module", | ||
@@ -42,6 +42,7 @@ "author": "withastro", | ||
"@astrojs/webapi": "^1.1.1", | ||
"@vercel/nft": "^0.22.1" | ||
"@vercel/nft": "^0.22.1", | ||
"fast-glob": "^3.2.11" | ||
}, | ||
"devDependencies": { | ||
"astro": "1.6.2", | ||
"astro": "1.6.9", | ||
"astro-scripts": "0.0.9", | ||
@@ -48,0 +49,0 @@ "chai": "^4.3.6", |
import type { AstroAdapter, AstroConfig, AstroIntegration } from 'astro'; | ||
import glob from 'fast-glob'; | ||
import { pathToFileURL } from 'url'; | ||
import { getVercelOutput, removeDir, writeJson } from '../lib/fs.js'; | ||
@@ -69,2 +71,19 @@ import { copyDependenciesToFunction } from '../lib/nft.js'; | ||
'astro:build:done': async ({ routes }) => { | ||
// Merge any includes from `vite.assetsInclude | ||
const inc = includeFiles?.map((file) => new URL(file, _config.root)) || []; | ||
if (_config.vite.assetsInclude) { | ||
const mergeGlobbedIncludes = (globPattern: unknown) => { | ||
if (typeof globPattern === 'string') { | ||
const entries = glob.sync(globPattern).map((p) => pathToFileURL(p)); | ||
inc.push(...entries); | ||
} else if (Array.isArray(globPattern)) { | ||
for (const pattern of globPattern) { | ||
mergeGlobbedIncludes(pattern); | ||
} | ||
} | ||
}; | ||
mergeGlobbedIncludes(_config.vite.assetsInclude); | ||
} | ||
// Copy necessary files (e.g. node_modules/) | ||
@@ -74,3 +93,3 @@ const { handler } = await copyDependenciesToFunction({ | ||
outDir: functionFolder, | ||
includeFiles: includeFiles?.map((file) => new URL(file, _config.root)) || [], | ||
includeFiles: inc, | ||
excludeFiles: excludeFiles?.map((file) => new URL(file, _config.root)) || [], | ||
@@ -77,0 +96,0 @@ }); |
Sorry, the diff of this file is not supported yet
70555
1279
3
+ Addedfast-glob@^3.2.11
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Addedfast-glob@3.3.3(transitive)
+ Addedfastq@1.19.0(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedmerge2@1.4.1(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrun-parallel@1.2.0(transitive)