From c95ccb6050d2383edbfcc3b4e9607a0d4073a1e2 Mon Sep 17 00:00:00 2001 From: Denis Golovin Date: Thu, 27 Apr 2023 20:46:37 -0700 Subject: [PATCH] Ignore certan warinigs from rollup Signed-off-by: Denis Golovin --- rollup.config.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 89b4881..3a066ce 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -31,9 +31,28 @@ export default { 'node:child_process', ], plugins: [ - typescript(), commonjs({ extensions: ['.js', '.ts'] }), // the ".ts" extension is required], json(), nodeResolve({preferBuiltins: true}), + typescript(), ], + onwarn: (warning) => { + // fail build if circular dependencies are found + const ignoredCircular = [ + 'sshpk', + '@kubernetes', + 'rimraf', + ]; + if ( + warning.code === 'CIRCULAR_DEPENDENCY' && ignoredCircular.some(d => warning.ids.find(id => id.includes(d))) + ) { + console.warn(`ignoring (!) ${warning.message}`); + return; + } + if (warning.code === 'THIS_IS_UNDEFINED' ) { + console.warn(`ignorign (!) ${warning.message}`); + return; + } + throw Error(warning); + } };