1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

build - log the bundle completion (#11555)

This commit is contained in:
kumavis 2021-07-20 09:23:39 -07:00 committed by GitHub
parent e0ba3eb6fc
commit 284c03879e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,6 +189,7 @@ function createFactoredBuild({
return async function () { return async function () {
// create bundler setup and apply defaults // create bundler setup and apply defaults
const buildConfiguration = createBuildConfiguration(); const buildConfiguration = createBuildConfiguration();
buildConfiguration.label = 'primary';
const { bundlerOpts, events } = buildConfiguration; const { bundlerOpts, events } = buildConfiguration;
// devMode options // devMode options
@ -288,6 +289,7 @@ function createFactoredBuild({
} }
function createNormalBundle({ function createNormalBundle({
label,
destFilepath, destFilepath,
entryFilepath, entryFilepath,
extraEntries = [], extraEntries = [],
@ -299,6 +301,7 @@ function createNormalBundle({
return async function () { return async function () {
// create bundler setup and apply defaults // create bundler setup and apply defaults
const buildConfiguration = createBuildConfiguration(); const buildConfiguration = createBuildConfiguration();
buildConfiguration.label = label;
const { bundlerOpts, events } = buildConfiguration; const { bundlerOpts, events } = buildConfiguration;
// devMode options // devMode options
@ -341,6 +344,7 @@ function createNormalBundle({
} }
function createBuildConfiguration() { function createBuildConfiguration() {
const label = '(unnamed bundle)';
const events = new EventEmitter(); const events = new EventEmitter();
const bundlerOpts = { const bundlerOpts = {
entries: [], entries: [],
@ -351,7 +355,7 @@ function createBuildConfiguration() {
manualExternal: [], manualExternal: [],
manualIgnore: [], manualIgnore: [],
}; };
return { bundlerOpts, events }; return { label, bundlerOpts, events };
} }
function setupBundlerDefaults( function setupBundlerDefaults(
@ -464,7 +468,7 @@ function setupSourcemaps(buildConfiguration, { devMode }) {
} }
async function bundleIt(buildConfiguration) { async function bundleIt(buildConfiguration) {
const { bundlerOpts, events } = buildConfiguration; const { label, bundlerOpts, events } = buildConfiguration;
const bundler = browserify(bundlerOpts); const bundler = browserify(bundlerOpts);
// manually apply non-standard options // manually apply non-standard options
bundler.external(bundlerOpts.manualExternal); bundler.external(bundlerOpts.manualExternal);
@ -474,7 +478,9 @@ async function bundleIt(buildConfiguration) {
// forward update event (used by watchify) // forward update event (used by watchify)
bundler.on('update', () => performBundle()); bundler.on('update', () => performBundle());
console.log(`bundle start: "${label}"`);
await performBundle(); await performBundle();
console.log(`bundle end: "${label}"`);
async function performBundle() { async function performBundle() {
// this pipeline is created for every bundle // this pipeline is created for every bundle