vite-plugin-vercel 11.1.0 → 11.1.1
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/api.d.ts +2 -3
- package/dist/api.js +1 -1
- package/dist/index.js +1 -1
- package/dist/vite.js +22 -16
- package/package.json +10 -10
- /package/dist/{api-DfSs-6Qg.js → api-DQ6GwdAx.js} +0 -0
- /package/dist/{path-CzW38gOA.js → path-5p9XRHnD.js} +0 -0
package/dist/api.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { PluginContext, ViteVercelConfig, ViteVercelRedirect, ViteVercelRewrite
|
|
|
2
2
|
import { VercelOutputConfig } from "@vite-plugin-vercel/schemas";
|
|
3
3
|
import { ViteDevServer } from "vite";
|
|
4
4
|
import { EntryMeta } from "@universal-deploy/store";
|
|
5
|
-
import * as _$_vercel_routing_utils0 from "@vercel/routing-utils";
|
|
6
5
|
|
|
7
6
|
//#region src/api.d.ts
|
|
8
7
|
declare function createAPI(outfiles: ViteVercelOutFile[], pluginConfig: ViteVercelConfig): {
|
|
@@ -14,7 +13,7 @@ declare function createAPI(outfiles: ViteVercelOutFile[], pluginConfig: ViteVerc
|
|
|
14
13
|
defaultMaxDuration: number | undefined;
|
|
15
14
|
expiration: number | undefined;
|
|
16
15
|
readonly rewrites: ViteVercelRewrite[];
|
|
17
|
-
readonly headers:
|
|
16
|
+
readonly headers: import("@vercel/routing-utils").Header[];
|
|
18
17
|
readonly redirects: ViteVercelRedirect[];
|
|
19
18
|
cleanUrls: boolean | undefined;
|
|
20
19
|
trailingSlash: boolean | undefined;
|
|
@@ -29,7 +28,7 @@ declare function getVercelAPI(pluginContextOrServer: Pick<PluginContext, "enviro
|
|
|
29
28
|
defaultMaxDuration: number | undefined;
|
|
30
29
|
expiration: number | undefined;
|
|
31
30
|
readonly rewrites: ViteVercelRewrite[];
|
|
32
|
-
readonly headers:
|
|
31
|
+
readonly headers: import("@vercel/routing-utils").Header[];
|
|
33
32
|
readonly redirects: ViteVercelRedirect[];
|
|
34
33
|
cleanUrls: boolean | undefined;
|
|
35
34
|
trailingSlash: boolean | undefined;
|
package/dist/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as getVercelAPI, t as createAPI } from "./api-
|
|
1
|
+
import { n as getVercelAPI, t as createAPI } from "./api-DQ6GwdAx.js";
|
|
2
2
|
export { createAPI, getVercelAPI };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as pathRelativeTo } from "./path-
|
|
1
|
+
import { t as pathRelativeTo } from "./path-5p9XRHnD.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { vercelEndpointExports } from "@vite-plugin-vercel/schemas";
|
|
4
4
|
import { fromNextFs } from "convert-route/next-fs";
|
package/dist/vite.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as pathRelativeTo$1 } from "./path-
|
|
2
|
-
import { n as getVercelAPI, r as assert, t as createAPI } from "./api-
|
|
1
|
+
import { t as pathRelativeTo$1 } from "./path-5p9XRHnD.js";
|
|
2
|
+
import { n as getVercelAPI, r as assert, t as createAPI } from "./api-DQ6GwdAx.js";
|
|
3
3
|
import { builtinModules } from "node:module";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { vercelOutputConfigSchema, vercelOutputPrerenderConfigSchema, vercelOutputVcConfigSchema } from "@vite-plugin-vercel/schemas";
|
|
@@ -811,11 +811,13 @@ function setupEnvs(pluginConfig) {
|
|
|
811
811
|
buildApp: {
|
|
812
812
|
order: "post",
|
|
813
813
|
async handler(builder) {
|
|
814
|
-
|
|
815
|
-
|
|
814
|
+
const vercelClientEnv = builder.environments[envNames.client];
|
|
815
|
+
if (!vercelClientEnv.isBuilt) try {
|
|
816
|
+
await builder.build(vercelClientEnv);
|
|
816
817
|
} catch (e) {
|
|
817
|
-
if (e instanceof Error && e.message.includes(`Could not resolve entry module "index.html"`))
|
|
818
|
+
if (!(e instanceof Error && e.message.includes(`Could not resolve entry module "index.html"`))) throw e;
|
|
818
819
|
}
|
|
820
|
+
await copyClientOutput(vercelClientEnv);
|
|
819
821
|
if (envNames.edge !== false && !builder.environments[envNames.edge].isBuilt) await builder.build(builder.environments[envNames.edge]);
|
|
820
822
|
if (!builder.environments[envNames.node].isBuilt) await builder.build(builder.environments[envNames.node]);
|
|
821
823
|
}
|
|
@@ -919,17 +921,6 @@ function setupEnvs(pluginConfig) {
|
|
|
919
921
|
},
|
|
920
922
|
generateBundle: { async handler(_opts, bundle) {
|
|
921
923
|
cleanupDummy(bundle);
|
|
922
|
-
const topLevelConfig = this.environment.getTopLevelConfig();
|
|
923
|
-
const clientEnv = topLevelConfig.environments.client;
|
|
924
|
-
if (clientEnv) try {
|
|
925
|
-
await cp(path.join(topLevelConfig.root, clientEnv.build.outDir), this.environment.config.build.outDir, {
|
|
926
|
-
recursive: true,
|
|
927
|
-
force: true,
|
|
928
|
-
dereference: true
|
|
929
|
-
});
|
|
930
|
-
} catch (e) {
|
|
931
|
-
if (e instanceof Error && e.message.includes("ENOENT")) {} else throw e;
|
|
932
|
-
}
|
|
933
924
|
} },
|
|
934
925
|
sharedDuringBuild: true
|
|
935
926
|
}
|
|
@@ -970,6 +961,21 @@ function cleanupDummy(bundle) {
|
|
|
970
961
|
const dummy = Object.keys(bundle).find((key) => key.includes("_DUMMY_"));
|
|
971
962
|
if (dummy) delete bundle[dummy];
|
|
972
963
|
}
|
|
964
|
+
async function copyClientOutput(vercelClientEnv) {
|
|
965
|
+
const topLevelConfig = vercelClientEnv.getTopLevelConfig();
|
|
966
|
+
const srcDir = path.resolve(topLevelConfig.root, topLevelConfig.environments.client.build.outDir);
|
|
967
|
+
const destDir = path.resolve(topLevelConfig.root, vercelClientEnv.config.build.outDir);
|
|
968
|
+
if (srcDir === destDir) return;
|
|
969
|
+
try {
|
|
970
|
+
await cp(srcDir, destDir, {
|
|
971
|
+
recursive: true,
|
|
972
|
+
force: true,
|
|
973
|
+
dereference: true
|
|
974
|
+
});
|
|
975
|
+
} catch (e) {
|
|
976
|
+
if (!(e instanceof Error && "code" in e && e.code === "ENOENT")) throw e;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
973
979
|
//#endregion
|
|
974
980
|
//#region src/plugins/index.ts
|
|
975
981
|
function vercel(pluginConfig = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-vercel",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -24,25 +24,25 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^22.19.15",
|
|
27
|
-
"tsdown": "^0.22.
|
|
27
|
+
"tsdown": "^0.22.2",
|
|
28
28
|
"typescript": "^6.0.3",
|
|
29
|
-
"vite": "^7.3.
|
|
30
|
-
"vitest": "^4.1.
|
|
29
|
+
"vite": "^7.3.5",
|
|
30
|
+
"vitest": "^4.1.8"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@manypkg/find-root": "^3.1.0",
|
|
34
34
|
"@universal-deploy/store": "^0.2.1",
|
|
35
|
-
"@universal-deploy/vite": "^0.1.
|
|
36
|
-
"@vercel/build-utils": "^13.
|
|
37
|
-
"@vercel/nft": "^1.
|
|
35
|
+
"@universal-deploy/vite": "^0.1.10",
|
|
36
|
+
"@vercel/build-utils": "^13.27.1",
|
|
37
|
+
"@vercel/nft": "^1.10.2",
|
|
38
38
|
"@vercel/routing-utils": "^6.2.0",
|
|
39
39
|
"convert-route": "^1.1.1",
|
|
40
40
|
"fast-glob": "^3.3.3",
|
|
41
|
-
"magicast": "^0.5.
|
|
41
|
+
"magicast": "^0.5.3",
|
|
42
42
|
"nf3": "^0.3.17",
|
|
43
|
-
"oxc-transform": "^0.
|
|
43
|
+
"oxc-transform": "^0.134.0",
|
|
44
44
|
"p-limit": "^7.3.0",
|
|
45
|
-
"rolldown": "^1.
|
|
45
|
+
"rolldown": "^1.1.0",
|
|
46
46
|
"@vite-plugin-vercel/schemas": "^1.1.1"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
File without changes
|
|
File without changes
|