vite-plugin-vercel 0.2.0 → 0.2.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/index.cjs CHANGED
@@ -322,7 +322,13 @@ async function buildFn(resolvedConfig, entry, buildOptions) {
322
322
  }
323
323
  }
324
324
  if (entry.edge) {
325
- options.conditions = ["edge-light", ...options.conditions ?? []];
325
+ options.conditions = [
326
+ "edge-light",
327
+ "browser",
328
+ "module",
329
+ "import",
330
+ "require"
331
+ ];
326
332
  }
327
333
  await (0, import_esbuild.build)(options);
328
334
  await writeVcConfig(resolvedConfig, entry.destination, Boolean(entry.edge));
@@ -481,25 +487,24 @@ async function getIsrConfig(resolvedConfig) {
481
487
  var import_path5 = __toESM(require("path"), 1);
482
488
  function vercelPlugin() {
483
489
  let resolvedConfig;
490
+ let vpsFound = false;
484
491
  return {
485
492
  apply: "build",
486
493
  name: "vite-plugin-vercel",
487
494
  enforce: "post",
488
495
  configResolved(config) {
489
496
  resolvedConfig = config;
490
- },
491
- async buildStart() {
492
- if (process.env.VERCEL_ENV === "production" && !process.env.ENABLE_VC_BUILD) {
493
- throw new Error(
494
- "Missing ENABLE_VC_BUILD=1 to your environment variables in your project settings"
495
- );
496
- }
497
+ vpsFound = resolvedConfig.plugins.some(
498
+ (p) => p.name.startsWith("vite-plugin-ssr:")
499
+ );
497
500
  },
498
501
  async writeBundle() {
499
502
  var _a;
500
503
  if (!((_a = resolvedConfig.build) == null ? void 0 : _a.ssr)) {
501
504
  await cleanOutputDirectory(resolvedConfig);
502
- return;
505
+ if (vpsFound) {
506
+ return;
507
+ }
503
508
  }
504
509
  const overrides = await execPrerender(resolvedConfig);
505
510
  const userOverrides = await computeStaticHtmlOverrides(resolvedConfig);
package/dist/index.js CHANGED
@@ -288,7 +288,13 @@ async function buildFn(resolvedConfig, entry, buildOptions) {
288
288
  }
289
289
  }
290
290
  if (entry.edge) {
291
- options.conditions = ["edge-light", ...options.conditions ?? []];
291
+ options.conditions = [
292
+ "edge-light",
293
+ "browser",
294
+ "module",
295
+ "import",
296
+ "require"
297
+ ];
292
298
  }
293
299
  await build(options);
294
300
  await writeVcConfig(resolvedConfig, entry.destination, Boolean(entry.edge));
@@ -447,25 +453,24 @@ async function getIsrConfig(resolvedConfig) {
447
453
  import path5 from "path";
448
454
  function vercelPlugin() {
449
455
  let resolvedConfig;
456
+ let vpsFound = false;
450
457
  return {
451
458
  apply: "build",
452
459
  name: "vite-plugin-vercel",
453
460
  enforce: "post",
454
461
  configResolved(config) {
455
462
  resolvedConfig = config;
456
- },
457
- async buildStart() {
458
- if (process.env.VERCEL_ENV === "production" && !process.env.ENABLE_VC_BUILD) {
459
- throw new Error(
460
- "Missing ENABLE_VC_BUILD=1 to your environment variables in your project settings"
461
- );
462
- }
463
+ vpsFound = resolvedConfig.plugins.some(
464
+ (p) => p.name.startsWith("vite-plugin-ssr:")
465
+ );
463
466
  },
464
467
  async writeBundle() {
465
468
  var _a;
466
469
  if (!((_a = resolvedConfig.build) == null ? void 0 : _a.ssr)) {
467
470
  await cleanOutputDirectory(resolvedConfig);
468
- return;
471
+ if (vpsFound) {
472
+ return;
473
+ }
469
474
  }
470
475
  const overrides = await execPrerender(resolvedConfig);
471
476
  const userOverrides = await computeStaticHtmlOverrides(resolvedConfig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-vercel",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -24,19 +24,19 @@
24
24
  "vite": "^4.2.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@types/node": "^16.18.30",
28
- "@typescript-eslint/eslint-plugin": "^5.59.5",
29
- "@typescript-eslint/parser": "^5.59.5",
30
- "eslint": "^8.40.0",
27
+ "@types/node": "^16.18.37",
28
+ "@typescript-eslint/eslint-plugin": "^5.60.1",
29
+ "@typescript-eslint/parser": "^5.60.1",
30
+ "eslint": "^8.43.0",
31
31
  "tsup": "^6.7.0",
32
- "typescript": "^5.0.4",
33
- "vite": "^4.3.5"
32
+ "typescript": "^5.1.6",
33
+ "vite": "^4.3.9"
34
34
  },
35
35
  "dependencies": {
36
36
  "@brillout/libassert": "^0.5.8",
37
37
  "@vercel/routing-utils": "^2.2.1",
38
38
  "esbuild": "^0.17.19",
39
- "fast-glob": "^3.2.12",
39
+ "fast-glob": "^3.3.0",
40
40
  "zod": "^3.21.4"
41
41
  },
42
42
  "scripts": {