@architect/inventory 4.0.6 → 4.0.7
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
|
@@ -22,7 +22,9 @@ module.exports = async function getPluginModules ({ arc, inventory, errors }) {
|
|
|
22
22
|
if (arc?.macros?.length) tagPlugins(arc.macros, 'macro')
|
|
23
23
|
|
|
24
24
|
let { node } = process.versions
|
|
25
|
-
let
|
|
25
|
+
let nodeVersionParts = node.split('.')
|
|
26
|
+
let nodeMajorVer = Number(nodeVersionParts[0])
|
|
27
|
+
let nodeMinorVer = Number(nodeVersionParts[1])
|
|
26
28
|
|
|
27
29
|
for (let pluginItem of pluginItems) {
|
|
28
30
|
let { plugin, type } = pluginItem
|
|
@@ -55,7 +57,8 @@ module.exports = async function getPluginModules ({ arc, inventory, errors }) {
|
|
|
55
57
|
if (type === 'plugin') {
|
|
56
58
|
try {
|
|
57
59
|
plugins[name] = require(pluginPath)
|
|
58
|
-
|
|
60
|
+
// starting in node 20.19, you can now require() esm
|
|
61
|
+
if ((nodeMajorVer >= 22 || (nodeMajorVer >= 20 && nodeMinorVer >= 19)) && plugins[name].default) {
|
|
59
62
|
plugins[name] = plugins[name].default
|
|
60
63
|
}
|
|
61
64
|
}
|