Skip to content

Commit 28e1c53

Browse files
committed
fix(server): only warn sourcemap when explicitly turned on in loadAndTransform
1 parent 6c4bf26 commit 28e1c53

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/vite/src/node/server/transformRequest.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,11 @@ async function loadAndTransform(
240240

241241
code = code.replace(convertSourceMap.mapFileCommentRegex, blankReplacer)
242242
} catch (e) {
243-
logger.warn(`Failed to load source map for ${url}.`, {
244-
timestamp: true,
245-
})
243+
if (server.config.build.sourcemap) {
244+
logger.warn(`Failed to load source map for ${url}.`, {
245+
timestamp: true,
246+
})
247+
}
246248
}
247249
}
248250
} else {

0 commit comments

Comments
 (0)