Skip to content

Commit

Permalink
Ignore certan warinigs from rollup
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Golovin <[email protected]>
  • Loading branch information
dgolovin committed Apr 28, 2023
1 parent ce69f7a commit c95ccb6
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};

0 comments on commit c95ccb6

Please sign in to comment.