Skip to content

Commit 346d635

Browse files
committed
refactor: update image loader logic
1 parent f062b53 commit 346d635

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/runtime/src/helpers/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const configureHandlerFunctions = async ({ netlifyConfig, publish, ignore
9292
}
9393

9494
/* eslint-enable no-underscore-dangle */
95-
[HANDLER_FUNCTION_NAME, ODB_FUNCTION_NAME].forEach((functionName) => {
95+
;[HANDLER_FUNCTION_NAME, ODB_FUNCTION_NAME].forEach((functionName) => {
9696
netlifyConfig.functions[functionName] ||= { included_files: [], external_node_modules: [] }
9797
netlifyConfig.functions[functionName].node_bundler = 'nft'
9898
netlifyConfig.functions[functionName].included_files ||= []

packages/runtime/src/helpers/functions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,18 @@ export const setupImageFunction = async ({
7272
responseHeaders?: Record<string, string>
7373
}): Promise<void> => {
7474
const imagePath = imageconfig.path || '/_next/image'
75-
75+
7676
if (isEnvSet('DISABLE_IPX')) {
7777
// If no image loader is specified, need to redirect to a 404 page since there's no
7878
// backing loader to serve local site images
79-
if (!imageconfig.loader) {
79+
if (imageconfig.loader && imageconfig.loader === 'default') {
8080
netlifyConfig.redirects.push({
8181
from: `${imagePath}*`,
8282
query: { url: ':url', w: ':width', q: ':quality' },
8383
to: '/404.html',
8484
status: 404,
85-
force: true
86-
})
85+
force: true,
86+
})
8787
}
8888
} else {
8989
const functionsPath = INTERNAL_FUNCTIONS_SRC || FUNCTIONS_SRC

0 commit comments

Comments
 (0)