@netlify/plugin-nextjs 4.2.7 → 4.2.8

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/lib/constants.js CHANGED
@@ -9,6 +9,7 @@ exports.HIDDEN_PATHS = [
9
9
  '/cache/*',
10
10
  '/server/*',
11
11
  '/serverless/*',
12
+ '/trace',
12
13
  '/traces',
13
14
  '/routes-manifest.json',
14
15
  '/build-manifest.json',
@@ -13,7 +13,7 @@ const getPageResolver_1 = require("../templates/getPageResolver");
13
13
  const generateFunctions = async ({ FUNCTIONS_SRC = constants_1.DEFAULT_FUNCTIONS_SRC, INTERNAL_FUNCTIONS_SRC, PUBLISH_DIR }, appDir) => {
14
14
  const functionsDir = INTERNAL_FUNCTIONS_SRC || FUNCTIONS_SRC;
15
15
  const functionDir = (0, pathe_1.join)(process.cwd(), functionsDir, constants_1.HANDLER_FUNCTION_NAME);
16
- const publishDir = (0, pathe_1.relative)(functionDir, (0, pathe_1.join)(process.cwd(), PUBLISH_DIR));
16
+ const publishDir = (0, pathe_1.relative)(functionDir, (0, pathe_1.resolve)(PUBLISH_DIR));
17
17
  const writeHandler = async (func, isODB) => {
18
18
  const handlerSource = await (0, getHandler_1.getHandler)({ isODB, publishDir, appDir: (0, pathe_1.relative)(functionDir, appDir) });
19
19
  await (0, fs_extra_1.ensureDir)((0, pathe_1.join)(functionsDir, func));
@@ -66,7 +66,7 @@ const checkNextSiteHasBuilt = ({ publish, failBuild, }) => {
66
66
  ? `Your publish directory is set to "out", but in most cases it should be ".next".`
67
67
  : `In most cases it should be set to ".next", unless you have chosen a custom "distDir" in your Next config.`;
68
68
  return failBuild((0, outdent_1.outdent) `
69
- The directory "${path_1.default.relative(process.cwd(), publish)}" does not contain a Next.js production build. Perhaps the build command was not run, or you specified the wrong publish directory.
69
+ The directory "${publish}" does not contain a Next.js production build. Perhaps the build command was not run, or you specified the wrong publish directory.
70
70
  ${outWarning}
71
71
  If you are using "next export" then you should set the environment variable NETLIFY_NEXT_PLUGIN_SKIP to "true".
72
72
  `);
@@ -82,7 +82,7 @@ exports.checkNextSiteHasBuilt = checkNextSiteHasBuilt;
82
82
  const checkForRootPublish = ({ publish, failBuild, }) => {
83
83
  if (path_1.default.resolve(publish) === path_1.default.resolve('.')) {
84
84
  failBuild((0, outdent_1.outdent) `
85
- Your publish directory is pointing to the base directory of your site. This is not supported for Next.js sites, and is probably a mistake.
85
+ Your publish directory is pointing to the base directory of your site. This is not supported for Next.js sites, and is probably a mistake.
86
86
  In most cases it should be set to ".next", unless you have chosen a custom "distDir" in your Next config, or the Next site is in a subdirectory.
87
87
  `);
88
88
  }
@@ -14,6 +14,9 @@ const { augmentFsModule, getMaxAge, getMultiValueHeaders, getNextServer } = requ
14
14
  // eslint-disable-next-line max-params
15
15
  const makeHandler = (conf, app, pageRoot, staticManifest = [], mode = 'ssr') => {
16
16
  var _a;
17
+ // Change working directory into the site root
18
+ const dir = path.resolve(__dirname, app);
19
+ process.chdir(dir);
17
20
  // This is just so nft knows about the page entrypoints. It's not actually used
18
21
  try {
19
22
  // eslint-disable-next-line node/no-missing-require
@@ -45,7 +48,7 @@ const makeHandler = (conf, app, pageRoot, staticManifest = [], mode = 'ssr') =>
45
48
  const NextServer = getNextServer();
46
49
  const nextServer = new NextServer({
47
50
  conf,
48
- dir: path.resolve(__dirname, app),
51
+ dir,
49
52
  customServer: false,
50
53
  hostname: url.hostname,
51
54
  port,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/plugin-nextjs",
3
- "version": "4.2.7",
3
+ "version": "4.2.8",
4
4
  "description": "Run Next.js seamlessly on Netlify",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -54,7 +54,7 @@
54
54
  "homepage": "https://github.com/netlify/netlify-plugin-nextjs#readme",
55
55
  "dependencies": {
56
56
  "@netlify/functions": "^1.0.0",
57
- "@netlify/ipx": "^0.0.9",
57
+ "@netlify/ipx": "^0.0.10",
58
58
  "@vercel/node-bridge": "^2.1.0",
59
59
  "chalk": "^4.1.2",
60
60
  "fs-extra": "^10.0.0",
@@ -75,8 +75,8 @@
75
75
  "@babel/core": "^7.15.8",
76
76
  "@babel/preset-env": "^7.15.8",
77
77
  "@babel/preset-typescript": "^7.16.0",
78
- "@netlify/build": "^26.3.3",
79
- "@netlify/eslint-config-node": "^5.1.4",
78
+ "@netlify/build": "^26.5.0",
79
+ "@netlify/eslint-config-node": "^5.1.6",
80
80
  "@reach/dialog": "^0.16.2",
81
81
  "@reach/visually-hidden": "^0.16.0",
82
82
  "@testing-library/cypress": "^8.0.1",