@netlify/vite-plugin 2.2.3 → 2.3.0

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/main.js +3 -3
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -41,7 +41,6 @@ function netlify(options = {}) {
41
41
  name: "vite-plugin-netlify",
42
42
  async configureServer(viteDevServer) {
43
43
  const logger = createLoggerFromViteLogger(viteDevServer.config.logger);
44
- const { port } = viteDevServer.config.server;
45
44
  const { blobs, edgeFunctions, functions, middleware = true, redirects, staticFiles } = options;
46
45
  const netlifyDev = new NetlifyDev({
47
46
  blobs,
@@ -49,7 +48,7 @@ function netlify(options = {}) {
49
48
  functions,
50
49
  logger,
51
50
  redirects,
52
- serverAddress: `http://localhost:${port}`,
51
+ serverAddress: null,
53
52
  staticFiles: {
54
53
  ...staticFiles,
55
54
  directories: [viteDevServer.config.root, viteDevServer.config.publicDir]
@@ -64,7 +63,8 @@ function netlify(options = {}) {
64
63
  const result = await netlifyDev.handleAndIntrospectNodeRequest(nodeReq, {
65
64
  headersCollector: (key, value) => {
66
65
  headers[key] = value;
67
- }
66
+ },
67
+ serverAddress: `http://localhost:${nodeReq.socket.localPort}`
68
68
  });
69
69
  const isStaticFile = result?.type === "static";
70
70
  if (result && !isStaticFile) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/vite-plugin",
3
- "version": "2.2.3",
3
+ "version": "2.3.0",
4
4
  "description": "Vite plugin with a local emulation of the Netlify environment",
5
5
  "type": "module",
6
6
  "engines": {
@@ -36,7 +36,7 @@
36
36
  "vitest": "^3.0.0"
37
37
  },
38
38
  "dependencies": {
39
- "@netlify/dev": "4.2.2",
39
+ "@netlify/dev": "4.3.0",
40
40
  "@netlify/dev-utils": "^3.2.0",
41
41
  "chalk": "^5.4.1"
42
42
  },