@putout/engine-loader 15.3.0 → 15.3.1
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/lib/load/async-loader.js
CHANGED
|
@@ -47,6 +47,15 @@ async function cleverLoad(names, load = simpleImport) {
|
|
|
47
47
|
if (!e)
|
|
48
48
|
return reporter;
|
|
49
49
|
|
|
50
|
+
if (e.code === 'ERR_UNSUPPORTED_DIR_IMPORT') {
|
|
51
|
+
const fullName = require.resolve(name);
|
|
52
|
+
|
|
53
|
+
[e, reporter] = await tryToCatch(load, fullName);
|
|
54
|
+
|
|
55
|
+
if (!e)
|
|
56
|
+
return reporter;
|
|
57
|
+
}
|
|
58
|
+
|
|
50
59
|
if (e.code === 'ERR_MODULE_NOT_FOUND')
|
|
51
60
|
continue;
|
|
52
61
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports.report = () => 'hello';
|
package/package.json
CHANGED