Update nitro.config.js

This commit is contained in:
Nate Kelley 2025-09-02 14:25:16 -06:00
parent 37e2f2ca41
commit 7c0b49c9e7
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 18 additions and 15 deletions

View File

@ -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);
},