Skip to content

Commit

Permalink
fix: run separate module builds concurrently
Browse files Browse the repository at this point in the history
teclone committed Dec 16, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent ab927e5 commit 5fb86a6
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions src/modules/Bundler.ts
Original file line number Diff line number Diff line change
@@ -324,19 +324,31 @@ class Bundler {
}

/**
* runs the process
* runs build process for a specific module
* @param moduleFiles
* @param config
*/
async process() {
processModule(
moduleFiles: ModuleFiles,
config: CJSConfig | ESMConfig | DistConfig
) {
let promises: Promise<any>[] = [];
this.runBuild(promises, moduleFiles, config);
return Promise.all(promises).then(() => {
return (promises = null);
});
}

/**
* runs the process
*/
async process() {
// assemble module files
const moduleFiles = await this.getModulesFiles();

this.runBuild(promises, moduleFiles, this.config.cjsConfig);
this.runBuild(promises, moduleFiles, this.config.esmConfig);
this.runBuild(promises, moduleFiles, this.config.distConfig);

await Promise.all(promises);
await this.processModule(moduleFiles, this.config.cjsConfig);
await this.processModule(moduleFiles, this.config.esmConfig);
await this.processModule(moduleFiles, this.config.distConfig);
}
}

0 comments on commit 5fb86a6

Please sign in to comment.