@putout/bundle 5.0.3 → 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 +21 -12
- package/bundle/putout.min.js +1 -1
- package/bundle/putout.slim.js +21 -12
- package/package.json +1 -1
package/bundle/putout.slim.js
CHANGED
|
@@ -111585,11 +111585,12 @@ const simpleImport = async (url) => {
|
|
|
111585
111585
|
};
|
|
111586
111586
|
|
|
111587
111587
|
const {createRequire: createRequire$1} = module$1;
|
|
111588
|
-
|
|
111588
|
+
|
|
111589
111589
|
const {assign: assign$3} = Object;
|
|
111590
111590
|
const stub$2 = () => () => {};
|
|
111591
111591
|
|
|
111592
111592
|
const createAsyncLoader = (type, overrides = {}) => {
|
|
111593
|
+
const require = createRequire$1(import.meta.url);
|
|
111593
111594
|
const {
|
|
111594
111595
|
simpleImport: simpleImport$1 = simpleImport,
|
|
111595
111596
|
} = overrides;
|
|
@@ -111601,9 +111602,10 @@ const createAsyncLoader = (type, overrides = {}) => {
|
|
|
111601
111602
|
if (name.startsWith('import:')) {
|
|
111602
111603
|
const shortName = name.replace('import:', '');
|
|
111603
111604
|
|
|
111604
|
-
return await cleverLoad([
|
|
111605
|
-
|
|
111606
|
-
|
|
111605
|
+
return await cleverLoad([require.resolve(shortName)], {
|
|
111606
|
+
simpleImport: simpleImport$1,
|
|
111607
|
+
require,
|
|
111608
|
+
});
|
|
111607
111609
|
}
|
|
111608
111610
|
|
|
111609
111611
|
const namesBase = [
|
|
@@ -111618,24 +111620,32 @@ const createAsyncLoader = (type, overrides = {}) => {
|
|
|
111618
111620
|
...namesFromPluginsDirs,
|
|
111619
111621
|
]));
|
|
111620
111622
|
|
|
111621
|
-
return await cleverLoad(names,
|
|
111623
|
+
return await cleverLoad(names, {
|
|
111624
|
+
simpleImport: simpleImport$1,
|
|
111625
|
+
require,
|
|
111626
|
+
});
|
|
111622
111627
|
};
|
|
111623
111628
|
};
|
|
111624
111629
|
|
|
111625
|
-
async function cleverLoad(names,
|
|
111630
|
+
async function cleverLoad(names, overrides) {
|
|
111631
|
+
const {
|
|
111632
|
+
simpleImport,
|
|
111633
|
+
require,
|
|
111634
|
+
} = overrides;
|
|
111635
|
+
|
|
111626
111636
|
let e;
|
|
111627
111637
|
let reporter;
|
|
111628
111638
|
|
|
111629
111639
|
for (const name of names) {
|
|
111630
|
-
[e, reporter] = await tryToCatch$1(
|
|
111640
|
+
[e, reporter] = await tryToCatch$1(simpleImport, name);
|
|
111631
111641
|
|
|
111632
111642
|
if (!e)
|
|
111633
111643
|
return reporter;
|
|
111634
111644
|
|
|
111635
111645
|
if (e.code === 'ERR_UNSUPPORTED_DIR_IMPORT') {
|
|
111636
|
-
const fullName = require
|
|
111646
|
+
const fullName = require.resolve(name);
|
|
111637
111647
|
|
|
111638
|
-
[e, reporter] = await tryToCatch$1(
|
|
111648
|
+
[e, reporter] = await tryToCatch$1(simpleImport, fullName);
|
|
111639
111649
|
|
|
111640
111650
|
if (!e)
|
|
111641
111651
|
return reporter;
|
|
@@ -112128,8 +112138,6 @@ function parseRuleName(rule) {
|
|
|
112128
112138
|
}
|
|
112129
112139
|
|
|
112130
112140
|
const {createRequire} = module$1;
|
|
112131
|
-
const require$1 = createRequire(import.meta.url);
|
|
112132
|
-
|
|
112133
112141
|
const {isArray: isArray$9} = Array;
|
|
112134
112142
|
|
|
112135
112143
|
const loadPlugins = (options) => {
|
|
@@ -112212,7 +112220,8 @@ function extendRules(rule, plugin) {
|
|
|
112212
112220
|
// add support of esm.sh
|
|
112213
112221
|
// https://github.com/esm-dev/esm.sh/issues/1045
|
|
112214
112222
|
function loadOnePlugin({name, namespace}) {
|
|
112215
|
-
const
|
|
112223
|
+
const require = createRequire(import.meta.url);
|
|
112224
|
+
const {loadPlugin} = require('../load/load.js');
|
|
112216
112225
|
|
|
112217
112226
|
return loadPlugin({
|
|
112218
112227
|
name,
|
package/package.json
CHANGED