Skip to content

Commit 6585dd7

Browse files
committed
chore: remove dynamic import handler flag from feature
1 parent 6c0a42f commit 6585dd7

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

packages/zip-it-and-ship-it/src/feature_flags.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ export const defaultFlags = {
2626

2727
// Adds the `___netlify-telemetry.mjs` file to the function bundle.
2828
zisi_add_instrumentation_loader: true,
29-
30-
// Dynamically import the function handler.
31-
zisi_dynamic_import_function_handler_entry_point: false,
3229
} as const
3330

3431
export type FeatureFlags = Partial<Record<keyof typeof defaultFlags, boolean>>

packages/zip-it-and-ship-it/src/runtimes/node/utils/entry_file.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,15 @@ export const kebabCase = (input: string): string =>
4545
const getEntryFileContents = (
4646
mainPath: string,
4747
moduleFormat: string,
48-
featureFlags: FeatureFlags,
48+
_featureFlags: FeatureFlags,
4949
runtimeAPIVersion: number,
5050
) => {
5151
const importPath = `.${mainPath.startsWith('/') ? mainPath : `/${mainPath}`}`
5252

5353
if (runtimeAPIVersion === 2) {
54-
if (featureFlags.zisi_dynamic_import_function_handler_entry_point) {
55-
return [
56-
`import * as bootstrap from './${BOOTSTRAP_FILE_NAME}'`,
57-
`export const handler = bootstrap.getLambdaHandler('${importPath}')`,
58-
].join(';')
59-
}
6054
return [
6155
`import * as bootstrap from './${BOOTSTRAP_FILE_NAME}'`,
62-
`import * as func from '${importPath}'`,
63-
64-
// See https://esbuild.github.io/content-types/#default-interop.
65-
'const funcModule = typeof func.default === "function" ? func : func.default',
66-
67-
`export const handler = bootstrap.getLambdaHandler(funcModule)`,
56+
`export const handler = bootstrap.getLambdaHandler('${importPath}')`,
6857
].join(';')
6958
}
7059

0 commit comments

Comments
 (0)