@netlify/plugin-nextjs 5.2.0 → 5.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/run/next.cjs CHANGED
@@ -38,12 +38,9 @@ var require_lists = __commonJS({
38
38
  value: true
39
39
  });
40
40
  exports2.fsSyncMethods = exports2.fsProps = exports2.fsAsyncMethods = void 0;
41
- var fsProps = ["constants", "F_OK", "R_OK", "W_OK", "X_OK", "Stats"];
42
- exports2.fsProps = fsProps;
43
- var fsSyncMethods = ["renameSync", "ftruncateSync", "truncateSync", "chownSync", "fchownSync", "lchownSync", "chmodSync", "fchmodSync", "lchmodSync", "statSync", "lstatSync", "fstatSync", "linkSync", "symlinkSync", "readlinkSync", "realpathSync", "unlinkSync", "rmdirSync", "mkdirSync", "mkdirpSync", "readdirSync", "closeSync", "openSync", "utimesSync", "futimesSync", "fsyncSync", "writeSync", "readSync", "readFileSync", "writeFileSync", "appendFileSync", "existsSync", "accessSync", "fdatasyncSync", "mkdtempSync", "copyFileSync", "rmSync", "createReadStream", "createWriteStream"];
44
- exports2.fsSyncMethods = fsSyncMethods;
45
- var fsAsyncMethods = ["rename", "ftruncate", "truncate", "chown", "fchown", "lchown", "chmod", "fchmod", "lchmod", "stat", "lstat", "fstat", "link", "symlink", "readlink", "realpath", "unlink", "rmdir", "mkdir", "mkdirp", "readdir", "close", "open", "utimes", "futimes", "fsync", "write", "read", "readFile", "writeFile", "appendFile", "exists", "access", "fdatasync", "mkdtemp", "copyFile", "rm", "watchFile", "unwatchFile", "watch"];
46
- exports2.fsAsyncMethods = fsAsyncMethods;
41
+ var fsProps = exports2.fsProps = ["constants", "F_OK", "R_OK", "W_OK", "X_OK", "Stats"];
42
+ var fsSyncMethods = exports2.fsSyncMethods = ["renameSync", "ftruncateSync", "truncateSync", "chownSync", "fchownSync", "lchownSync", "chmodSync", "fchmodSync", "lchmodSync", "statSync", "lstatSync", "fstatSync", "linkSync", "symlinkSync", "readlinkSync", "realpathSync", "unlinkSync", "rmdirSync", "mkdirSync", "mkdirpSync", "readdirSync", "closeSync", "openSync", "utimesSync", "futimesSync", "fsyncSync", "writeSync", "readSync", "readFileSync", "writeFileSync", "appendFileSync", "existsSync", "accessSync", "fdatasyncSync", "mkdtempSync", "copyFileSync", "rmSync", "createReadStream", "createWriteStream"];
43
+ var fsAsyncMethods = exports2.fsAsyncMethods = ["rename", "ftruncate", "truncate", "chown", "fchown", "lchown", "chmod", "fchmod", "lchmod", "stat", "lstat", "fstat", "link", "symlink", "readlink", "realpath", "unlink", "rmdir", "mkdir", "mkdirp", "readdir", "close", "open", "utimes", "futimes", "fsync", "write", "read", "readFile", "writeFile", "appendFile", "exists", "access", "fdatasync", "mkdtemp", "copyFile", "rm", "watchFile", "unwatchFile", "watch"];
47
44
  }
48
45
  });
49
46
 
@@ -235,56 +232,42 @@ var require_correctPath = __commonJS({
235
232
  var require_patchRequire = __commonJS({
236
233
  "node_modules/fs-monkey/lib/patchRequire.js"(exports2) {
237
234
  "use strict";
238
- function _typeof(obj) {
235
+ function _typeof(o) {
239
236
  "@babel/helpers - typeof";
240
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
241
- return typeof obj2;
242
- } : function(obj2) {
243
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
244
- }, _typeof(obj);
237
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
238
+ return typeof o2;
239
+ } : function(o2) {
240
+ return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
241
+ }, _typeof(o);
245
242
  }
246
243
  Object.defineProperty(exports2, "__esModule", {
247
244
  value: true
248
245
  });
249
246
  exports2["default"] = patchRequire;
250
247
  var path = _interopRequireWildcard(require("path"));
251
- function _getRequireWildcardCache(nodeInterop) {
252
- if (typeof WeakMap !== "function")
248
+ function _getRequireWildcardCache(e) {
249
+ if ("function" != typeof WeakMap)
253
250
  return null;
254
- var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
255
- var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
256
- return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
257
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
258
- })(nodeInterop);
251
+ var r = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
252
+ return (_getRequireWildcardCache = function _getRequireWildcardCache2(e2) {
253
+ return e2 ? t : r;
254
+ })(e);
259
255
  }
260
- function _interopRequireWildcard(obj, nodeInterop) {
261
- if (!nodeInterop && obj && obj.__esModule) {
262
- return obj;
263
- }
264
- if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
265
- return { "default": obj };
266
- }
267
- var cache = _getRequireWildcardCache(nodeInterop);
268
- if (cache && cache.has(obj)) {
269
- return cache.get(obj);
270
- }
271
- var newObj = {};
272
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
273
- for (var key in obj) {
274
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
275
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
276
- if (desc && (desc.get || desc.set)) {
277
- Object.defineProperty(newObj, key, desc);
278
- } else {
279
- newObj[key] = obj[key];
280
- }
256
+ function _interopRequireWildcard(e, r) {
257
+ if (!r && e && e.__esModule)
258
+ return e;
259
+ if (null === e || "object" != _typeof(e) && "function" != typeof e)
260
+ return { "default": e };
261
+ var t = _getRequireWildcardCache(r);
262
+ if (t && t.has(e))
263
+ return t.get(e);
264
+ var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor;
265
+ for (var u in e)
266
+ if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
267
+ var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
268
+ i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
281
269
  }
282
- }
283
- newObj["default"] = obj;
284
- if (cache) {
285
- cache.set(obj, newObj);
286
- }
287
- return newObj;
270
+ return n["default"] = e, t && t.set(e, n), n;
288
271
  }
289
272
  var isWin32 = process.platform === "win32";
290
273
  var correctPath = isWin32 ? require_correctPath().correctPath : function(p) {
@@ -470,13 +453,13 @@ var require_patchRequire = __commonJS({
470
453
  var require_lib = __commonJS({
471
454
  "node_modules/fs-monkey/lib/index.js"(exports2) {
472
455
  "use strict";
473
- function _typeof(obj) {
456
+ function _typeof(o) {
474
457
  "@babel/helpers - typeof";
475
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
476
- return typeof obj2;
477
- } : function(obj2) {
478
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
479
- }, _typeof(obj);
458
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
459
+ return typeof o2;
460
+ } : function(o2) {
461
+ return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
462
+ }, _typeof(o);
480
463
  }
481
464
  Object.defineProperty(exports2, "__esModule", {
482
465
  value: true
@@ -505,43 +488,29 @@ var require_lib = __commonJS({
505
488
  var _correctPath = require_correctPath();
506
489
  var util = _interopRequireWildcard(require_lists());
507
490
  exports2.util = util;
508
- function _getRequireWildcardCache(nodeInterop) {
509
- if (typeof WeakMap !== "function")
491
+ function _getRequireWildcardCache(e) {
492
+ if ("function" != typeof WeakMap)
510
493
  return null;
511
- var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
512
- var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
513
- return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
514
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
515
- })(nodeInterop);
494
+ var r = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
495
+ return (_getRequireWildcardCache = function _getRequireWildcardCache2(e2) {
496
+ return e2 ? t : r;
497
+ })(e);
516
498
  }
517
- function _interopRequireWildcard(obj, nodeInterop) {
518
- if (!nodeInterop && obj && obj.__esModule) {
519
- return obj;
520
- }
521
- if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
522
- return { "default": obj };
523
- }
524
- var cache = _getRequireWildcardCache(nodeInterop);
525
- if (cache && cache.has(obj)) {
526
- return cache.get(obj);
527
- }
528
- var newObj = {};
529
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
530
- for (var key in obj) {
531
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
532
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
533
- if (desc && (desc.get || desc.set)) {
534
- Object.defineProperty(newObj, key, desc);
535
- } else {
536
- newObj[key] = obj[key];
537
- }
499
+ function _interopRequireWildcard(e, r) {
500
+ if (!r && e && e.__esModule)
501
+ return e;
502
+ if (null === e || "object" != _typeof(e) && "function" != typeof e)
503
+ return { "default": e };
504
+ var t = _getRequireWildcardCache(r);
505
+ if (t && t.has(e))
506
+ return t.get(e);
507
+ var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor;
508
+ for (var u in e)
509
+ if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
510
+ var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
511
+ i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
538
512
  }
539
- }
540
- newObj["default"] = obj;
541
- if (cache) {
542
- cache.set(obj, newObj);
543
- }
544
- return newObj;
513
+ return n["default"] = e, t && t.set(e, n), n;
545
514
  }
546
515
  function _interopRequireDefault(obj) {
547
516
  return obj && obj.__esModule ? obj : { "default": obj };
@@ -118,11 +118,12 @@ export const buildResponse = async ({
118
118
 
119
119
  let rewrite = res.headers.get('x-middleware-rewrite')
120
120
  let redirect = res.headers.get('location')
121
+ let nextRedirect = res.headers.get('x-nextjs-redirect')
121
122
 
122
123
  // Data requests (i.e. requests for /_next/data ) need special handling
123
124
  const isDataReq = request.headers.has('x-nextjs-data')
124
125
  // Data requests need to be normalized to the route path
125
- if (isDataReq && !redirect && !rewrite) {
126
+ if (isDataReq && !redirect && !rewrite && !nextRedirect) {
126
127
  const requestUrl = new URL(request.url)
127
128
  const normalizedDataUrl = normalizeDataUrl(requestUrl.pathname)
128
129
  // Don't rewrite unless the URL has changed
@@ -209,7 +210,7 @@ export const buildResponse = async ({
209
210
  res.headers.set('x-nextjs-redirect', relativizeURL(redirect, request.url))
210
211
  }
211
212
 
212
- const nextRedirect = res.headers.get('x-nextjs-redirect')
213
+ nextRedirect = res.headers.get('x-nextjs-redirect')
213
214
 
214
215
  if (nextRedirect && isDataReq) {
215
216
  res.headers.set('x-nextjs-redirect', normalizeDataUrl(nextRedirect))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/plugin-nextjs",
3
- "version": "5.2.0",
3
+ "version": "5.2.1",
4
4
  "description": "Run Next.js seamlessly on Netlify",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",