From 77e86e1ab7ca15cc0fde9430b680a42b97fa4973 Mon Sep 17 00:00:00 2001 From: Harrison Ifeanyichukwu Date: Wed, 13 May 2020 06:27:19 +0200 Subject: [PATCH] fix: fixed build errors --- rollup.config.js | 2 +- src/modules/Bundler.ts | 30 +++++++++++++++--------------- src/modules/utils.ts | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 08c1be8..77d1d84 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,2 +1,2 @@ -const { config } = require('./lib'); +const { config } = require('./temp'); module.exports = config({}); diff --git a/src/modules/Bundler.ts b/src/modules/Bundler.ts index 8a9b54b..fcb52a1 100644 --- a/src/modules/Bundler.ts +++ b/src/modules/Bundler.ts @@ -285,6 +285,7 @@ class Bundler { : allExternal; const onWarn = (warning, warn) => { + console.log(warning.message); warn(warning); }; @@ -301,21 +302,20 @@ class Bundler { external, onwarn: onWarn, }) - .then((bundler) => { - return bundler - .write({ - file: out, - format: config.format, - interop: config.interop, - sourcemap: config.sourcemap, - name, - }) - .then(() => { - if (this.bundlerOptions.generateOutputLogs) { - log(chalk.green(`${oldRelativePath} ... ${out} \n`)); - } - return null; - }); + .then((bundler) => + bundler.write({ + file: out, + format: config.format, + interop: config.interop, + sourcemap: config.sourcemap, + name, + }), + ) + .then(() => { + if (this.bundlerOptions.generateOutputLogs) { + log(chalk.green(`${oldRelativePath} ... ${out} \n`)); + } + return null; }) .catch(onError), ); diff --git a/src/modules/utils.ts b/src/modules/utils.ts index eb3a490..5153aae 100644 --- a/src/modules/utils.ts +++ b/src/modules/utils.ts @@ -100,12 +100,12 @@ export const getRollupPlugins = ( babelrc: false, presets: getBabelPresets( - generalConfig?.babelConfig?.presets, + generalConfig?.babelConfig?.presets || [], internalNodeModulesDir, ), plugins: getBabelPlugins( - generalConfig?.babelConfig?.plugins, + generalConfig?.babelConfig?.plugins || [], internalNodeModulesDir, buildConfig.format === 'esm', ),