mirror of https://github.com/buster-so/buster.git
Update nitro.config.js
This commit is contained in:
parent
37e2f2ca41
commit
7c0b49c9e7
|
@ -2,14 +2,30 @@ export default {
|
|||
sourcemap: false,
|
||||
rollupConfig: {
|
||||
onwarn(warning, defaultHandler) {
|
||||
const message = warning.message || "";
|
||||
|
||||
// Suppress "use client" directive warnings
|
||||
if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
|
||||
if (message.includes("node_modules/")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Suppress 'this' keyword warnings in ES modules
|
||||
if (warning.code === "THIS_IS_UNDEFINED") {
|
||||
// Only suppress for node_modules dependencies
|
||||
if (message.includes("node_modules/")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Also suppress by message content for broader coverage
|
||||
if (message.includes("The 'this' keyword is equivalent to 'undefined'")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Suppress legitimate third-party circular dependency warnings
|
||||
if (warning.code === "CIRCULAR_DEPENDENCY") {
|
||||
const message = warning.message || "";
|
||||
// Suppress nitropack internal circular dependencies (framework issue)
|
||||
if (message.includes("nitropack/dist/runtime/internal/")) {
|
||||
return;
|
||||
|
@ -23,21 +39,8 @@ export default {
|
|||
if (message.includes("juice/lib/")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
message.includes("The 'this' keyword is equivalent to 'undefined'")
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (warning.code === "THIS_IS_UNDEFINED") {
|
||||
const message = warning.message || "";
|
||||
// Only suppress for node_modules dependencies
|
||||
if (message.includes("node_modules/")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handle all other warnings normally
|
||||
defaultHandler(warning);
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue