vite-plugin-vercel 5.0.2 → 5.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +13 -8
- package/dist/index.js +13 -8
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -294,7 +294,7 @@ var vercelEndpointExports = import_zod3.z.object({
|
|
|
294
294
|
var import_magicast = require("magicast");
|
|
295
295
|
var import_build_utils = require("@vercel/build-utils");
|
|
296
296
|
var import_nft = require("@vercel/nft");
|
|
297
|
-
var
|
|
297
|
+
var import_find_root = require("@manypkg/find-root");
|
|
298
298
|
function getAdditionalEndpoints(resolvedConfig) {
|
|
299
299
|
var _a;
|
|
300
300
|
return (((_a = resolvedConfig.vercel) == null ? void 0 : _a.additionalEndpoints) ?? []).map((e) => ({
|
|
@@ -410,12 +410,12 @@ async function buildFn(resolvedConfig, entry, buildOptions) {
|
|
|
410
410
|
options.format = "esm";
|
|
411
411
|
} else if (options.format === "esm") {
|
|
412
412
|
options.banner = {
|
|
413
|
-
js: `import { createRequire } from
|
|
414
|
-
import
|
|
415
|
-
import
|
|
416
|
-
const require =
|
|
417
|
-
const __filename =
|
|
418
|
-
const __dirname =
|
|
413
|
+
js: `import { createRequire as VPV_createRequire } from "node:module";
|
|
414
|
+
import { fileURLToPath as VPV_fileURLToPath } from "node:url";
|
|
415
|
+
import { dirname as VPV_dirname } from "node:path";
|
|
416
|
+
const require = VPV_createRequire(import.meta.url);
|
|
417
|
+
const __filename = VPV_fileURLToPath(import.meta.url);
|
|
418
|
+
const __dirname = VPV_dirname(__filename);
|
|
419
419
|
`
|
|
420
420
|
};
|
|
421
421
|
}
|
|
@@ -423,7 +423,12 @@ const __dirname = path.dirname(__filename);
|
|
|
423
423
|
options.plugins.push(vercelOgPlugin(ctx));
|
|
424
424
|
const output = await (0, import_esbuild.build)(options);
|
|
425
425
|
if (typeof entry.source == "string") {
|
|
426
|
-
|
|
426
|
+
let base = resolvedConfig.root;
|
|
427
|
+
try {
|
|
428
|
+
const dir = await (0, import_find_root.findRoot)(resolvedConfig.root);
|
|
429
|
+
base = dir.rootDir;
|
|
430
|
+
} catch (e) {
|
|
431
|
+
}
|
|
427
432
|
const { fileList, reasons } = await (0, import_nft.nodeFileTrace)([entry.source], {
|
|
428
433
|
base,
|
|
429
434
|
processCwd: resolvedConfig.root,
|
package/dist/index.js
CHANGED
|
@@ -264,7 +264,7 @@ var vercelEndpointExports = z3.object({
|
|
|
264
264
|
import { generateCode, loadFile } from "magicast";
|
|
265
265
|
import { getNodeVersion } from "@vercel/build-utils";
|
|
266
266
|
import { nodeFileTrace } from "@vercel/nft";
|
|
267
|
-
import {
|
|
267
|
+
import { findRoot } from "@manypkg/find-root";
|
|
268
268
|
function getAdditionalEndpoints(resolvedConfig) {
|
|
269
269
|
var _a;
|
|
270
270
|
return (((_a = resolvedConfig.vercel) == null ? void 0 : _a.additionalEndpoints) ?? []).map((e) => ({
|
|
@@ -380,12 +380,12 @@ async function buildFn(resolvedConfig, entry, buildOptions) {
|
|
|
380
380
|
options.format = "esm";
|
|
381
381
|
} else if (options.format === "esm") {
|
|
382
382
|
options.banner = {
|
|
383
|
-
js: `import { createRequire } from
|
|
384
|
-
import
|
|
385
|
-
import
|
|
386
|
-
const require =
|
|
387
|
-
const __filename =
|
|
388
|
-
const __dirname =
|
|
383
|
+
js: `import { createRequire as VPV_createRequire } from "node:module";
|
|
384
|
+
import { fileURLToPath as VPV_fileURLToPath } from "node:url";
|
|
385
|
+
import { dirname as VPV_dirname } from "node:path";
|
|
386
|
+
const require = VPV_createRequire(import.meta.url);
|
|
387
|
+
const __filename = VPV_fileURLToPath(import.meta.url);
|
|
388
|
+
const __dirname = VPV_dirname(__filename);
|
|
389
389
|
`
|
|
390
390
|
};
|
|
391
391
|
}
|
|
@@ -393,7 +393,12 @@ const __dirname = path.dirname(__filename);
|
|
|
393
393
|
options.plugins.push(vercelOgPlugin(ctx));
|
|
394
394
|
const output = await build(options);
|
|
395
395
|
if (typeof entry.source == "string") {
|
|
396
|
-
|
|
396
|
+
let base = resolvedConfig.root;
|
|
397
|
+
try {
|
|
398
|
+
const dir = await findRoot(resolvedConfig.root);
|
|
399
|
+
base = dir.rootDir;
|
|
400
|
+
} catch (e) {
|
|
401
|
+
}
|
|
397
402
|
const { fileList, reasons } = await nodeFileTrace([entry.source], {
|
|
398
403
|
base,
|
|
399
404
|
processCwd: resolvedConfig.root,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-vercel",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -34,17 +34,18 @@
|
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^16.18.76",
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
38
|
-
"@typescript-eslint/parser": "^7.
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^7.3.1",
|
|
38
|
+
"@typescript-eslint/parser": "^7.3.1",
|
|
39
39
|
"eslint": "^8.57.0",
|
|
40
40
|
"tsup": "^8.0.2",
|
|
41
|
-
"typescript": "^5.4.
|
|
42
|
-
"vike": "^0.4.
|
|
43
|
-
"vite": "^5.
|
|
41
|
+
"typescript": "^5.4.3",
|
|
42
|
+
"vike": "^0.4.167",
|
|
43
|
+
"vite": "^5.2.6",
|
|
44
44
|
"@vite-plugin-vercel/vike": "5.0.2"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@brillout/libassert": "^0.5.8",
|
|
48
|
+
"@manypkg/find-root": "^2.2.1",
|
|
48
49
|
"@vercel/build-utils": "^7.9.1",
|
|
49
50
|
"@vercel/nft": "^0.26.4",
|
|
50
51
|
"@vercel/routing-utils": "^3.1.0",
|
|
@@ -52,7 +53,6 @@
|
|
|
52
53
|
"eval": "^0.1.8",
|
|
53
54
|
"fast-glob": "^3.3.2",
|
|
54
55
|
"magicast": "^0.3.3",
|
|
55
|
-
"workspace-root": "^3.2.0",
|
|
56
56
|
"zod": "^3.22.4"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|