@putout/bundle 5.0.4 → 5.0.5
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/bundle/putout.js +18 -9
- package/bundle/putout.min.js +1 -1
- package/bundle/putout.slim.js +18 -9
- package/package.json +1 -1
package/bundle/putout.js
CHANGED
|
@@ -111586,11 +111586,11 @@ const simpleImport = async (url) => {
|
|
|
111586
111586
|
|
|
111587
111587
|
const {createRequire: createRequire$1} = module$1;
|
|
111588
111588
|
|
|
111589
|
-
const require$1 = createRequire$1(import.meta.url);
|
|
111590
111589
|
const {assign: assign$3} = Object;
|
|
111591
111590
|
const stub$2 = () => () => {};
|
|
111592
111591
|
|
|
111593
111592
|
const createAsyncLoader = (type, overrides = {}) => {
|
|
111593
|
+
const require = createRequire$1(import.meta.url);
|
|
111594
111594
|
const {
|
|
111595
111595
|
simpleImport: simpleImport$1 = simpleImport,
|
|
111596
111596
|
} = overrides;
|
|
@@ -111602,9 +111602,10 @@ const createAsyncLoader = (type, overrides = {}) => {
|
|
|
111602
111602
|
if (name.startsWith('import:')) {
|
|
111603
111603
|
const shortName = name.replace('import:', '');
|
|
111604
111604
|
|
|
111605
|
-
return await cleverLoad([
|
|
111606
|
-
|
|
111607
|
-
|
|
111605
|
+
return await cleverLoad([require.resolve(shortName)], {
|
|
111606
|
+
simpleImport: simpleImport$1,
|
|
111607
|
+
require,
|
|
111608
|
+
});
|
|
111608
111609
|
}
|
|
111609
111610
|
|
|
111610
111611
|
const namesBase = [
|
|
@@ -111619,24 +111620,32 @@ const createAsyncLoader = (type, overrides = {}) => {
|
|
|
111619
111620
|
...namesFromPluginsDirs,
|
|
111620
111621
|
]));
|
|
111621
111622
|
|
|
111622
|
-
return await cleverLoad(names,
|
|
111623
|
+
return await cleverLoad(names, {
|
|
111624
|
+
simpleImport: simpleImport$1,
|
|
111625
|
+
require,
|
|
111626
|
+
});
|
|
111623
111627
|
};
|
|
111624
111628
|
};
|
|
111625
111629
|
|
|
111626
|
-
async function cleverLoad(names,
|
|
111630
|
+
async function cleverLoad(names, overrides) {
|
|
111631
|
+
const {
|
|
111632
|
+
simpleImport,
|
|
111633
|
+
require,
|
|
111634
|
+
} = overrides;
|
|
111635
|
+
|
|
111627
111636
|
let e;
|
|
111628
111637
|
let reporter;
|
|
111629
111638
|
|
|
111630
111639
|
for (const name of names) {
|
|
111631
|
-
[e, reporter] = await tryToCatch$1(
|
|
111640
|
+
[e, reporter] = await tryToCatch$1(simpleImport, name);
|
|
111632
111641
|
|
|
111633
111642
|
if (!e)
|
|
111634
111643
|
return reporter;
|
|
111635
111644
|
|
|
111636
111645
|
if (e.code === 'ERR_UNSUPPORTED_DIR_IMPORT') {
|
|
111637
|
-
const fullName = require
|
|
111646
|
+
const fullName = require.resolve(name);
|
|
111638
111647
|
|
|
111639
|
-
[e, reporter] = await tryToCatch$1(
|
|
111648
|
+
[e, reporter] = await tryToCatch$1(simpleImport, fullName);
|
|
111640
111649
|
|
|
111641
111650
|
if (!e)
|
|
111642
111651
|
return reporter;
|