@architect/inventory 3.4.1 → 3.4.3-RC.0
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/package.json
CHANGED
|
@@ -21,7 +21,8 @@ module.exports = function getHandler ({ config, src, build, errors }) {
|
|
|
21
21
|
}
|
|
22
22
|
// Compiled to a binary
|
|
23
23
|
else if (customRuntimeType === 'compiled') {
|
|
24
|
-
handlerFile = join(build, runtimeConfig.handlerFile || '
|
|
24
|
+
handlerFile = join(build, runtimeConfig.buildSubpath || '', runtimeConfig.handlerFile || 'bootstrap')
|
|
25
|
+
handlerMethod = null
|
|
25
26
|
}
|
|
26
27
|
// Interpreted
|
|
27
28
|
else if (customRuntimeType === 'interpreted') {
|
|
@@ -47,8 +48,16 @@ function getExt ({ runtime, src, errors }) {
|
|
|
47
48
|
// This presumes Node.js ≥14 Lambda releases use the same CJS/ESM pattern
|
|
48
49
|
// Generally in Lambda: CJS wins, but in Architect-land we attempt to default to ESM
|
|
49
50
|
else {
|
|
50
|
-
let { file, ext
|
|
51
|
+
let { file, ext } = findHandler(nodeHandlers, src)
|
|
52
|
+
|
|
53
|
+
// Early return on extensions that imply module type
|
|
54
|
+
if (ext === 'mjs') return { file, ext, handlerModuleSystem: 'esm' }
|
|
55
|
+
if (ext === 'cjs') return { file, ext, handlerModuleSystem: 'cjs' }
|
|
56
|
+
|
|
57
|
+
// In the odd case that there only exists an `index` file (no ext), default to ESM and let other things blow up when it's not found
|
|
58
|
+
ext = ext || 'mjs'
|
|
51
59
|
let handlerModuleSystem = ext === 'mjs' ? 'esm' : 'cjs'
|
|
60
|
+
|
|
52
61
|
let pkgFile = join(src, 'package.json')
|
|
53
62
|
if (existsSync(pkgFile)) {
|
|
54
63
|
let pkg = JSON.parse(readFileSync(pkgFile))
|