mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 21:58:19 +00:00
fix(nuxi, vite): suppress sourcemap + native fetch warnings (#20198)
This commit is contained in:
parent
0443a283d9
commit
89ab2e522d
@ -54,6 +54,11 @@ const wrapReporter = (reporter: ConsolaReporter) => ({
|
||||
if (msg.startsWith('[Vue Router warn]: No match found for location with path')) {
|
||||
return
|
||||
}
|
||||
// Suppress warning about native Node.js fetch
|
||||
if (msg.includes('ExperimentalWarning: The Fetch API is an experimental feature')) {
|
||||
return
|
||||
}
|
||||
// TODO: resolve upstream in Vite
|
||||
// Hide sourcemap warnings related to node_modules
|
||||
if (msg.startsWith('Sourcemap') && msg.includes('node_modules')) {
|
||||
return
|
||||
|
@ -27,6 +27,12 @@ export function createViteLogger (config: vite.InlineConfig): vite.Logger {
|
||||
const clearScreen = canClearScreen ? clear : () => {}
|
||||
|
||||
function output (type: vite.LogType, msg: string, options: vite.LogErrorOptions = {}) {
|
||||
if (typeof msg === 'string' && !process.env.DEBUG) {
|
||||
// TODO: resolve upstream in Vite
|
||||
// Hide sourcemap warnings related to node_modules
|
||||
if (msg.startsWith('Sourcemap') && msg.includes('node_modules')) { return }
|
||||
}
|
||||
|
||||
const sameAsLast = lastType === type && lastMsg === msg
|
||||
if (sameAsLast) {
|
||||
duplicateCount += 1
|
||||
|
Loading…
Reference in New Issue
Block a user