MCPcopy
hub / github.com/brunch/brunch / build

Function build

lib/index.js:32–48  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

30};
31
32function build(options) {
33 const hasDebug = obj => {
34 return obj && typeof obj === 'object' && obj.debug;
35 };
36 const isDebug = hasDebug(options);
37 if (isDebug) {
38 let ns = typeof isDebug === 'string' ? isDebug : '*';
39 if (ns !== 'speed') ns = `brunch:${ns}`;
40 process.env.DEBUG = ns;
41 }
42 const {BrunchWatcher} = require('./watch');
43 // We require `watch` after we assigned `process.env.DEBUG` any value.
44 // Otherwise it would be `undefined` and debug messages wouldn't be shown.
45 const watcher = new BrunchWatcher(options);
46 watcher.init();
47 return watcher;
48};
49
50exports.new = create;
51exports.build = options => build({path: '.', ...options, persistent: false});

Callers 1

index.jsFile · 0.85

Calls 3

initMethod · 0.95
hasDebugFunction · 0.85
requireFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…