From 18b121fdd59c5f8e319fd6e0d9778098d4402249 Mon Sep 17 00:00:00 2001 From: Harrison Ifeanyichukwu Date: Sat, 14 Mar 2020 18:26:02 +0100 Subject: [PATCH] fix: fixed build --- src/modules/Bundler.ts | 30 +++++++----------------------- tsconfig.json | 1 + 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/modules/Bundler.ts b/src/modules/Bundler.ts index 0624927..b8efd85 100644 --- a/src/modules/Bundler.ts +++ b/src/modules/Bundler.ts @@ -254,11 +254,8 @@ class Bundler { return result; } - async runBuild( - promises: Promise[], - moduleFiles: ModuleFiles, - config: DistConfig | CJSConfig | ESMConfig, - ) { + runBuild(moduleFiles: ModuleFiles, config: DistConfig | CJSConfig | ESMConfig) { + const promises: Array> = []; const { assetFiles, typeDefinitionFiles, buildFiles } = moduleFiles; if (config.enabled) { log(chalk.yellow(`generating ${config.format} builds...\n`)); @@ -298,6 +295,7 @@ class Bundler { if (this.bundlerOptions.generateOutputLogs) { log(chalk.green(`${oldRelativePath} ... ${out} \n`)); } + return null; }); }) .catch(onError), @@ -326,22 +324,8 @@ class Bundler { ); }); } - } - /** - * runs build process for a specific module - * @param moduleFiles - * @param config - */ - async processModule( - moduleFiles: ModuleFiles, - config: CJSConfig | ESMConfig | DistConfig, - ) { - let promises: Promise[] = []; - await this.runBuild(promises, moduleFiles, config); - return Promise.all(promises).then(() => { - return (promises = null); - }); + return Promise.all(promises); } /** @@ -351,9 +335,9 @@ class Bundler { // assemble module files const moduleFiles = await this.getModulesFiles(); - await this.processModule(moduleFiles, this.config.cjsConfig); - await this.processModule(moduleFiles, this.config.esmConfig); - await this.processModule(moduleFiles, this.config.distConfig); + await this.runBuild(moduleFiles, this.config.cjsConfig); + await this.runBuild(moduleFiles, this.config.esmConfig); + await this.runBuild(moduleFiles, this.config.distConfig); } } diff --git a/tsconfig.json b/tsconfig.json index 13af2c6..5c4285e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,7 @@ "skipLibCheck": true, "noUnusedLocals": true, "noUnusedParameters": false, + "esModuleInterop": true, "module": "esnext", "jsx": "react", "lib": ["dom", "es5", "es2015.collection", "es2015.iterable"],