1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

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

This commit is contained in:
kumavis 2019-09-09 21:44:08 +08:00 committed by Mark Stacey
parent 5363d6aa2a
commit 0dad4db8de

View File

@ -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