lib/synthesize.js
/** Function to load plug-ins, using configurations additively. */
Function to load plug-ins, using configurations additively.
Function to load plug - ins using configurations additively .
function loadPlugins(...settings) {
        const loaded = new Set();
        for (const source of settings) {
            const plugins = source.get(['plugin']) || [];
            for (const plugin of plugins) {
                const resolved = tryResolve(plugin);
                if (loaded.has(resolved)) { continue; }
                debug(`Loading plug-in: ${colors.green(plugin)} from ${colors.blue(resolved)}`);
                PluginHost.instance.load(plugin);
                loaded.add(resolved);
            }
        }
        function tryResolve(plugin) {
            try {
                return require.resolve(plugin);
            } catch (e) {
                error(`Unable to resolve plugin ${colors.green(plugin)}: ${e.stack}`);
                throw new Error(`Unable to resolve plug-in: ${plugin}`);
            }
        }
    }
function loadPlugins ( ... settings ) { const loaded = new Set ( ) ; for ( const source of settings ) { const plugins = source . get ( [ 'plugin' ] ) || [ ] ; for ( const plugin of plugins ) { const resolved = tryResolve ( plugin ) ; if ( loaded . has ( resolved ) ) { continue ; } debug ( ` ${ colors . green ( plugin ) } ${ colors . blue ( resolved ) } ` ) ; PluginHost . instance . load ( plugin ) ; loaded . add ( resolved ) ; } } function tryResolve ( plugin ) { try { return require . resolve ( plugin ) ; } catch ( e ) { error ( ` ${ colors . green ( plugin ) } ${ e . stack } ` ) ; throw new Error ( ` ${ plugin } ` ) ; } } }
Function to load plug-ins, using configurations additively.
Function to load plug - ins using configurations additively .