@roots/bud
Version:
Configurable, extensible build tools for modern single and multi-page web applications
17 lines (16 loc) • 408 B
JavaScript
import { Bud } from '@roots/bud';
import logger from '@roots/bud-support/logger';
let instance;
const get = () => {
if (instance) {
logger.log(`Using cached instance`);
return instance;
}
set(new Bud());
return instance;
};
const set = (bud) => {
logger.log(`Instance cached to @roots/bud/instance`);
instance = bud;
};
export { get, instance as bud, instance, set };