feat: supress "use client" warnings in charts build with nebula build watch (#1371)

This commit is contained in:
Christofer Splittorff
2023-10-09 10:04:47 +02:00
committed by GitHub
parent 322523b8ab
commit b2443642eb

View File

@@ -67,10 +67,16 @@ const watch = async (argv) => {
const watcher = rollup.watch({
...c.input,
onwarn({ loc, message }) {
onwarn({ loc, message, code }) {
if (!hasWarnings) {
clearScreen();
}
// Supress "use client" warnings coming from MUI bundling
if (code === 'MODULE_LEVEL_DIRECTIVE' && message.includes(`"use client"`)) {
return;
}
console.log(
`${chalk.black.bgYellow(' WARN ')} ${chalk.yellow(
loc ? `${loc.file} (${loc.line}:${loc.column}) ${message}` : message