build - dont create bundler until task is actually run (#7117)

feature/default_network_editable
kumavis 5 years ago committed by Mark Stacey
parent 5363d6aa2a
commit 0dad4db8de
  1. 12
      gulpfile.js

@ -543,13 +543,19 @@ function generateBundler (opts, performBundle) {
}
function bundleTask (opts) {
const bundler = generateBundler(opts, performBundle)
// output build logs to terminal
bundler.on('log', gutil.log)
let bundler
return performBundle
function performBundle () {
// initialize bundler if not available yet
// dont create bundler until task is actually run
if (!bundler) {
bundler = generateBundler(opts, performBundle)
// output build logs to terminal
bundler.on('log', gutil.log)
}
let buildStream = bundler.bundle()
// handle errors

Loading…
Cancel
Save