1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +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 () {
// create bundler setup and apply defaults
const buildConfiguration = createBuildConfiguration();
buildConfiguration.label = 'primary';
const { bundlerOpts, events } = buildConfiguration;
// devMode options
@ -288,6 +289,7 @@ function createFactoredBuild({
}
function createNormalBundle({
label,
destFilepath,
entryFilepath,
extraEntries = [],
@ -299,6 +301,7 @@ function createNormalBundle({
return async function () {
// create bundler setup and apply defaults
const buildConfiguration = createBuildConfiguration();
buildConfiguration.label = label;
const { bundlerOpts, events } = buildConfiguration;
// devMode options
@ -341,6 +344,7 @@ function createNormalBundle({
}
function createBuildConfiguration() {
const label = '(unnamed bundle)';
const events = new EventEmitter();
const bundlerOpts = {
entries: [],
@ -351,7 +355,7 @@ function createBuildConfiguration() {
manualExternal: [],
manualIgnore: [],
};
return { bundlerOpts, events };
return { label, bundlerOpts, events };
}
function setupBundlerDefaults(
@ -464,7 +468,7 @@ function setupSourcemaps(buildConfiguration, { devMode }) {
}
async function bundleIt(buildConfiguration) {
const { bundlerOpts, events } = buildConfiguration;
const { label, bundlerOpts, events } = buildConfiguration;
const bundler = browserify(bundlerOpts);
// manually apply non-standard options
bundler.external(bundlerOpts.manualExternal);
@ -474,7 +478,9 @@ async function bundleIt(buildConfiguration) {
// forward update event (used by watchify)
bundler.on('update', () => performBundle());
console.log(`bundle start: "${label}"`);
await performBundle();
console.log(`bundle end: "${label}"`);
async function performBundle() {
// this pipeline is created for every bundle