@@ -68,11 +68,6 @@ const getEntryFileContents = (
68
68
] . join ( ';' )
69
69
}
70
70
71
- if ( featureFlags . zisi_unique_entry_file ) {
72
- // we use dynamic import because we do not know if the user code is cjs or esm
73
- return [ `const { handler } = await import('${ importPath } ')` , 'export { handler }' ] . join ( ';' )
74
- }
75
-
76
71
if ( moduleFormat === MODULE_FORMAT . COMMONJS ) {
77
72
return `module.exports = require('${ importPath } ')`
78
73
}
@@ -92,18 +87,16 @@ export const isNamedLikeEntryFile = (
92
87
file : string ,
93
88
{
94
89
basePath,
95
- featureFlags,
96
90
filename,
97
91
runtimeAPIVersion,
98
92
} : {
99
93
basePath : string
100
- featureFlags : FeatureFlags
101
94
filename : string
102
95
runtimeAPIVersion : number
103
96
} ,
104
97
) =>
105
98
POSSIBLE_LAMBDA_ENTRY_EXTENSIONS . some ( ( extension ) => {
106
- const entryFilename = getEntryFileName ( { extension, featureFlags , filename, runtimeAPIVersion } )
99
+ const entryFilename = getEntryFileName ( { extension, filename, runtimeAPIVersion } )
107
100
const entryFilePath = resolve ( basePath , entryFilename )
108
101
109
102
return entryFilePath === file
@@ -115,14 +108,12 @@ export const conflictsWithEntryFile = (
115
108
{
116
109
basePath,
117
110
extension,
118
- featureFlags,
119
111
filename,
120
112
mainFile,
121
113
runtimeAPIVersion,
122
114
} : {
123
115
basePath : string
124
116
extension : string
125
- featureFlags : FeatureFlags
126
117
filename : string
127
118
mainFile : string
128
119
runtimeAPIVersion : number
@@ -143,13 +134,13 @@ export const conflictsWithEntryFile = (
143
134
144
135
// If we're generating a unique entry file, we know we don't have a conflict
145
136
// at this point.
146
- if ( featureFlags . zisi_unique_entry_file || runtimeAPIVersion === 2 ) {
137
+ if ( runtimeAPIVersion === 2 ) {
147
138
return
148
139
}
149
140
150
141
if (
151
142
! hasConflict &&
152
- isNamedLikeEntryFile ( srcFile , { basePath, featureFlags , filename, runtimeAPIVersion } ) &&
143
+ isNamedLikeEntryFile ( srcFile , { basePath, filename, runtimeAPIVersion } ) &&
153
144
srcFile !== mainFile
154
145
) {
155
146
hasConflict = true
@@ -164,16 +155,14 @@ export const conflictsWithEntryFile = (
164
155
// this it considers `<func-name>.(c|m)?js` as possible entry-points
165
156
const getEntryFileName = ( {
166
157
extension,
167
- featureFlags,
168
158
filename,
169
159
runtimeAPIVersion,
170
160
} : {
171
161
extension : ModuleFileExtension
172
- featureFlags : FeatureFlags
173
162
filename : string
174
163
runtimeAPIVersion : number
175
164
} ) => {
176
- if ( featureFlags . zisi_unique_entry_file || runtimeAPIVersion === 2 ) {
165
+ if ( runtimeAPIVersion === 2 ) {
177
166
return `${ ENTRY_FILE_NAME } .mjs`
178
167
}
179
168
@@ -233,7 +222,7 @@ export const getEntryFile = ({
233
222
} ) : EntryFile => {
234
223
const mainPath = normalizeFilePath ( { commonPrefix, path : mainFile , userNamespace } )
235
224
const extension = getFileExtensionForFormat ( moduleFormat , featureFlags , runtimeAPIVersion )
236
- const entryFilename = getEntryFileName ( { extension, featureFlags , filename, runtimeAPIVersion } )
225
+ const entryFilename = getEntryFileName ( { extension, filename, runtimeAPIVersion } )
237
226
const contents = getEntryFileContents ( mainPath , moduleFormat , featureFlags , runtimeAPIVersion )
238
227
239
228
return {
0 commit comments