Closed paulmillr closed 8 years ago
@goshakkk
@paulmillr what do you think about something like
const bindToDeppack = (fnName) => {
return function() {
if (!deppack) return;
return deppack[fnName].apply(deppack, arguments);
};
};
['exploreDeps', 'processFiles', 'wrapInModule', 'needsProcessing', 'isNpm', 'isNpmJSON', 'isShim', 'getAllDependents'].forEach(fnName => {
exports[fnName] = bindToDeppack(fnName);
});
exports.loadInit = (config, json) => {
deppack = config.npm.enabled ? new Deppack(config, json) : new NoDeppack();
return deppack.init();
};
to achieve the desired result (aka being able to import only the needed function and call it from brunch)
Still doesn't work when there are >1 deppacks.
There's never more than one at any given point.
Feels weird the current way.