From c6e1810edf092f9c137412564e6d25a6890fb0d2 Mon Sep 17 00:00:00 2001 From: da730 Date: Mon, 29 Jan 2024 19:59:52 +0800 Subject: [PATCH] fix: ci build error --- tools/bundler/src/logic/rollup.config.ts | 7 ------- tools/bundler/src/tasks/umd.ts | 9 +++++++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/bundler/src/logic/rollup.config.ts b/tools/bundler/src/logic/rollup.config.ts index 287fa29c..09a603c3 100644 --- a/tools/bundler/src/logic/rollup.config.ts +++ b/tools/bundler/src/logic/rollup.config.ts @@ -38,13 +38,6 @@ export function getRollupOptions( input: entry, external: getExternal(rawPackageJson, config.external), ...config.rollupOptions, - onwarn: function (warning) { - // eslint-disable-next-line no-console - console.log(warning.code, warning.message); - if (warning.code === 'THIS_IS_UNDEFINED' || warning.code === 'SOURCEMAP_ERROR') { - return; - } - }, plugins: [ resolve(), commonjs(), diff --git a/tools/bundler/src/tasks/umd.ts b/tools/bundler/src/tasks/umd.ts index 797a00d3..c07dcd26 100644 --- a/tools/bundler/src/tasks/umd.ts +++ b/tools/bundler/src/tasks/umd.ts @@ -29,8 +29,13 @@ export async function buildUmd(config: Config, projectRoot: string, rawPackageJs const rollupOptions = getRollupOptions(projectRoot, entry, rawPackageJson, babelPlugins, { ...config, minify }); DebugConfig('RollupOptions', JSON.stringify(rollupOptions)); - const bundle = await rollup(rollupOptions); - + let bundle; + try { + bundle = await rollup(rollupOptions); + } catch (e) { + // eslint-disable-next-line no-console + console.error('error--------', e); + } const dest = path.resolve(projectRoot, config.outputDir.umd!); await generateOutputs(bundle, [ {