@netlify/plugin-nextjs 4.8.0 → 4.9.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.
@@ -40,7 +40,7 @@ const generatePagesResolver = async ({ constants: { INTERNAL_FUNCTIONS_SRC, FUNC
40
40
  };
41
41
  exports.generatePagesResolver = generatePagesResolver;
42
42
  // Move our next/image function into the correct functions directory
43
- const setupImageFunction = async ({ constants: { INTERNAL_FUNCTIONS_SRC, FUNCTIONS_SRC = constants_1.DEFAULT_FUNCTIONS_SRC }, imageconfig = {}, netlifyConfig, basePath, }) => {
43
+ const setupImageFunction = async ({ constants: { INTERNAL_FUNCTIONS_SRC, FUNCTIONS_SRC = constants_1.DEFAULT_FUNCTIONS_SRC }, imageconfig = {}, netlifyConfig, basePath, remotePatterns, }) => {
44
44
  const functionsPath = INTERNAL_FUNCTIONS_SRC || FUNCTIONS_SRC;
45
45
  const functionName = `${constants_1.IMAGE_FUNCTION_NAME}.js`;
46
46
  const functionDirectory = (0, pathe_1.join)(functionsPath, constants_1.IMAGE_FUNCTION_NAME);
@@ -48,6 +48,7 @@ const setupImageFunction = async ({ constants: { INTERNAL_FUNCTIONS_SRC, FUNCTIO
48
48
  await (0, fs_extra_1.writeJSON)((0, pathe_1.join)(functionDirectory, 'imageconfig.json'), {
49
49
  ...imageconfig,
50
50
  basePath: [basePath, constants_1.IMAGE_FUNCTION_NAME].join('/'),
51
+ remotePatterns,
51
52
  });
52
53
  await (0, fs_extra_1.copyFile)((0, pathe_1.join)(__dirname, '..', '..', 'lib', 'templates', 'ipx.js'), (0, pathe_1.join)(functionDirectory, functionName));
53
54
  const imagePath = imageconfig.path || '/_next/image';
package/lib/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ /* eslint-disable max-lines */
3
4
  const path_1 = require("path");
4
5
  const chalk_1 = require("chalk");
5
6
  const fs_extra_1 = require("fs-extra");
@@ -38,7 +39,7 @@ const plugin = {
38
39
  }
39
40
  const { publish } = netlifyConfig.build;
40
41
  (0, verification_1.checkNextSiteHasBuilt)({ publish, failBuild });
41
- const { appDir, basePath, i18n, images, target, ignore, trailingSlash, outdir } = await (0, config_1.getNextConfig)({
42
+ const { appDir, basePath, i18n, images, target, ignore, trailingSlash, outdir, experimental: { images: { remotePatterns }, }, } = await (0, config_1.getNextConfig)({
42
43
  publish,
43
44
  failBuild,
44
45
  });
@@ -68,7 +69,7 @@ const plugin = {
68
69
  netlifyConfig,
69
70
  nextConfig: { basePath, i18n },
70
71
  });
71
- await (0, functions_1.setupImageFunction)({ constants, imageconfig: images, netlifyConfig, basePath });
72
+ await (0, functions_1.setupImageFunction)({ constants, imageconfig: images, netlifyConfig, basePath, remotePatterns });
72
73
  await (0, redirects_1.generateRedirects)({
73
74
  netlifyConfig,
74
75
  nextConfig: { basePath, i18n, trailingSlash, appDir },
@@ -105,3 +106,4 @@ const plugin = {
105
106
  },
106
107
  };
107
108
  module.exports = plugin;
109
+ /* eslint-enable max-lines */
@@ -7,5 +7,6 @@ const imageconfig_json_1 = require("./imageconfig.json");
7
7
  exports.handler = (0, ipx_1.createIPXHandler)({
8
8
  basePath: imageconfig_json_1.basePath,
9
9
  domains: imageconfig_json_1.domains,
10
+ remotePatterns: imageconfig_json_1.remotePatterns,
10
11
  });
11
12
  /* eslint-enable node/no-missing-import, import/no-unresolved, @typescript-eslint/ban-ts-comment */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/plugin-nextjs",
3
- "version": "4.8.0",
3
+ "version": "4.9.0",
4
4
  "description": "Run Next.js seamlessly on Netlify",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "@netlify/functions": "^1.0.0",
13
- "@netlify/ipx": "^1.0.1",
13
+ "@netlify/ipx": "^1.1.0",
14
14
  "@vercel/node-bridge": "^2.1.0",
15
15
  "chalk": "^4.1.2",
16
16
  "fs-extra": "^10.0.0",
@@ -32,7 +32,7 @@
32
32
  "@types/fs-extra": "^9.0.13",
33
33
  "@types/jest": "^27.4.1",
34
34
  "@types/node": "^17.0.25",
35
- "next": "^12.1.6",
35
+ "next": "^12.1.7-canary.33",
36
36
  "npm-run-all": "^4.1.5",
37
37
  "typescript": "^4.6.3"
38
38
  },
@@ -34,7 +34,7 @@ export interface RequestData {
34
34
 
35
35
  const handler = async (req: Request, context: Context) => {
36
36
  const url = new URL(req.url)
37
- if (url.pathname.startsWith('/_next/')) {
37
+ if (url.pathname.startsWith('/_next/static/')) {
38
38
  return
39
39
  }
40
40