vite-plugin-vercel 11.0.0-beta.4 → 11.0.0-beta.6

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.
Files changed (2) hide show
  1. package/dist/vite.js +14 -6
  2. package/package.json +1 -1
package/dist/vite.js CHANGED
@@ -69,7 +69,12 @@ function removeExtension$1(subject) {
69
69
  //#endregion
70
70
  //#region src/utils/destination.ts
71
71
  function entryDestinationDefault(root, entry) {
72
- return `${removeExtension$1(pathRelativeTo$1(entry.id, root)).replace(/[^a-zA-Z0-9\-_[\]/]/g, "-")}`;
72
+ let rel = pathRelativeTo$1(entry.id, root);
73
+ if (rel.includes("node_modules")) {
74
+ const split = rel.split("node_modules");
75
+ rel = split[split.length - 1];
76
+ }
77
+ return `${removeExtension$1(rel).replace(/[^a-zA-Z0-9\-_[\]/]/g, "-")}`;
73
78
  }
74
79
  function entryDestination(root, entry, postfix) {
75
80
  return `${path.posix.join("functions/", entryDestinationDefault(root, entry))}${postfix}`;
@@ -216,7 +221,8 @@ async function bundle$1(pluginContext, bundledAssets, outfile) {
216
221
  const buildOptions = {};
217
222
  buildOptions.output = {
218
223
  format: "esm",
219
- legalComments: "none"
224
+ legalComments: "none",
225
+ inlineDynamicImports: true
220
226
  };
221
227
  buildOptions.checks = { pluginTimings: false };
222
228
  buildOptions.input = [source];
@@ -684,13 +690,13 @@ function setupEnvs(pluginConfig) {
684
690
  buildApp: {
685
691
  order: "post",
686
692
  async handler(builder) {
687
- try {
693
+ if (!builder.environments[envNames.client].isBuilt) try {
688
694
  await builder.build(builder.environments[envNames.client]);
689
695
  } catch (e) {
690
696
  if (e instanceof Error && e.message.includes(`Could not resolve entry module "index.html"`)) {} else throw e;
691
697
  }
692
- if (envNames.edge !== false) await builder.build(builder.environments[envNames.edge]);
693
- await builder.build(builder.environments[envNames.node]);
698
+ if (envNames.edge !== false && !builder.environments[envNames.edge].isBuilt) await builder.build(builder.environments[envNames.edge]);
699
+ if (!builder.environments[envNames.node].isBuilt) await builder.build(builder.environments[envNames.node]);
694
700
  }
695
701
  },
696
702
  config: {
@@ -818,7 +824,9 @@ function createVercelEnvironmentOptions(overrides) {
818
824
  rollupOptions: {
819
825
  input: getDummyInput(),
820
826
  output: {
821
- sanitizeFileName: false,
827
+ sanitizeFileName: (filename) => {
828
+ return filename.replace("\0", "_");
829
+ },
822
830
  sourcemap: false
823
831
  }
824
832
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-vercel",
3
- "version": "11.0.0-beta.4",
3
+ "version": "11.0.0-beta.6",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",