mirror of
https://github.com/SamEyeBam/animate.git
synced 2025-09-28 06:55:25 +00:00
larry babby and threejs for glsl
This commit is contained in:
26
webGl/my-threejs-test/node_modules/@parcel/transformer-posthtml/lib/loadPlugins.js
generated
vendored
Normal file
26
webGl/my-threejs-test/node_modules/@parcel/transformer-posthtml/lib/loadPlugins.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = loadExternalPlugins;
|
||||
async function loadExternalPlugins(plugins, relative, options) {
|
||||
if (Array.isArray(plugins)) {
|
||||
return Promise.all(plugins.map(p => loadPlugin(p, relative, null, options.packageManager, options.shouldAutoInstall)).filter(Boolean));
|
||||
} else if (typeof plugins === 'object') {
|
||||
let mapPlugins = await Promise.all(Object.keys(plugins).map(p => loadPlugin(p, relative, plugins[p], options.packageManager, options.shouldAutoInstall)));
|
||||
return mapPlugins.filter(Boolean);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
async function loadPlugin(pluginArg, relative, options = {}, packageManager, shouldAutoInstall) {
|
||||
if (typeof pluginArg !== 'string') {
|
||||
return pluginArg;
|
||||
}
|
||||
let plugin = await packageManager.require(pluginArg, relative, {
|
||||
shouldAutoInstall
|
||||
});
|
||||
plugin = plugin.default || plugin;
|
||||
return plugin(options);
|
||||
}
|
Reference in New Issue
Block a user