@netlify/plugin-nextjs
Advanced tools
Comparing version 4.39.4 to 4.40.0
@@ -199,3 +199,3 @@ "use strict"; | ||
// eslint-disable-next-line max-lines-per-function | ||
const writeEdgeFunctions = async ({ netlifyConfig, routesManifest, }) => { | ||
const writeEdgeFunctions = async ({ netlifyConfig, routesManifest, constants: { PACKAGE_PATH = '' }, }) => { | ||
var _a; | ||
@@ -208,3 +208,3 @@ const generator = await (0, functionsMetaData_1.getPluginVersion)(); | ||
}; | ||
const edgeFunctionRoot = (0, path_1.resolve)('.netlify', 'edge-functions'); | ||
const edgeFunctionRoot = (0, path_1.resolve)(PACKAGE_PATH, '.netlify', 'edge-functions'); | ||
await (0, fs_extra_1.emptyDir)(edgeFunctionRoot); | ||
@@ -211,0 +211,0 @@ const { publish } = netlifyConfig.build; |
@@ -24,3 +24,3 @@ "use strict"; | ||
const utils_1 = require("./utils"); | ||
const generateFunctions = async ({ FUNCTIONS_SRC = constants_1.DEFAULT_FUNCTIONS_SRC, INTERNAL_FUNCTIONS_SRC, PUBLISH_DIR }, appDir, apiLambdas, ssrLambdas) => { | ||
const generateFunctions = async ({ INTERNAL_FUNCTIONS_SRC, PUBLISH_DIR, PACKAGE_PATH = '', FUNCTIONS_SRC = (0, pathe_1.join)(PACKAGE_PATH, constants_1.DEFAULT_FUNCTIONS_SRC), }, appDir, apiLambdas, ssrLambdas) => { | ||
const publish = (0, pathe_1.resolve)(PUBLISH_DIR); | ||
@@ -99,5 +99,5 @@ const functionsDir = (0, pathe_1.resolve)(INTERNAL_FUNCTIONS_SRC || FUNCTIONS_SRC); | ||
*/ | ||
const generatePagesResolver = async ({ INTERNAL_FUNCTIONS_SRC, FUNCTIONS_SRC = constants_1.DEFAULT_FUNCTIONS_SRC, PUBLISH_DIR, }) => { | ||
const generatePagesResolver = async ({ INTERNAL_FUNCTIONS_SRC, PUBLISH_DIR, PACKAGE_PATH = '', FUNCTIONS_SRC = (0, pathe_1.join)(PACKAGE_PATH, constants_1.DEFAULT_FUNCTIONS_SRC), }) => { | ||
const functionsPath = INTERNAL_FUNCTIONS_SRC || FUNCTIONS_SRC; | ||
const jsSource = await (0, getPageResolver_1.getResolverForPages)(PUBLISH_DIR); | ||
const jsSource = await (0, getPageResolver_1.getResolverForPages)(PUBLISH_DIR, PACKAGE_PATH); | ||
await (0, fs_extra_1.writeFile)((0, pathe_1.join)(functionsPath, constants_1.ODB_FUNCTION_NAME, 'pages.js'), jsSource); | ||
@@ -108,3 +108,3 @@ await (0, fs_extra_1.writeFile)((0, pathe_1.join)(functionsPath, constants_1.HANDLER_FUNCTION_NAME, 'pages.js'), jsSource); | ||
// Move our next/image function into the correct functions directory | ||
const setupImageFunction = async ({ constants: { INTERNAL_FUNCTIONS_SRC, FUNCTIONS_SRC = constants_1.DEFAULT_FUNCTIONS_SRC, IS_LOCAL }, imageconfig = {}, netlifyConfig, basePath, remotePatterns, responseHeaders, }) => { | ||
const setupImageFunction = async ({ constants: { IS_LOCAL, INTERNAL_FUNCTIONS_SRC, PACKAGE_PATH = '', FUNCTIONS_SRC = (0, pathe_1.join)(PACKAGE_PATH, constants_1.DEFAULT_FUNCTIONS_SRC), }, imageconfig = {}, netlifyConfig, basePath, remotePatterns, responseHeaders, }) => { | ||
const imagePath = imageconfig.path || '/_next/image'; | ||
@@ -111,0 +111,0 @@ if ((0, destr_1.default)(process.env.DISABLE_IPX)) { |
@@ -131,3 +131,3 @@ "use strict"; | ||
}); | ||
await (0, edge_1.writeEdgeFunctions)({ netlifyConfig, routesManifest }); | ||
await (0, edge_1.writeEdgeFunctions)({ constants, netlifyConfig, routesManifest }); | ||
}, | ||
@@ -134,0 +134,0 @@ async onPostBuild({ netlifyConfig: { build: { publish }, redirects, headers, }, utils: { status, cache, functions, build: { failBuild }, }, constants: { FUNCTIONS_DIST }, }) { |
@@ -42,4 +42,4 @@ "use strict"; | ||
exports.getResolverForDependencies = getResolverForDependencies; | ||
const getResolverForPages = async (publish) => { | ||
const functionDir = (0, pathe_1.resolve)('.netlify', 'functions', constants_1.HANDLER_FUNCTION_NAME); | ||
const getResolverForPages = async (publish, packagePath) => { | ||
const functionDir = (0, pathe_1.resolve)(packagePath, '.netlify', 'functions', constants_1.HANDLER_FUNCTION_NAME); | ||
const dependencies = await (0, exports.getAllPageDependencies)(publish); | ||
@@ -46,0 +46,0 @@ return (0, exports.getResolverForDependencies)({ dependencies, functionDir }); |
{ | ||
"name": "@netlify/plugin-nextjs", | ||
"version": "4.39.4", | ||
"version": "4.40.0", | ||
"description": "Run Next.js seamlessly on Netlify", | ||
@@ -40,3 +40,3 @@ "main": "index.js", | ||
"@delucis/if-env": "^1.1.2", | ||
"@netlify/build": "^29.20.1", | ||
"@netlify/build": "^29.20.4", | ||
"@types/fs-extra": "^9.0.13", | ||
@@ -43,0 +43,0 @@ "@types/jest": "^27.4.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
217240