Skip to content

Commit 72050f9

Browse files
chaxusbluwy
andauthoredApr 7, 2023
fix: warn on build when bundling code that uses nodejs built in module (#12616)
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
1 parent da38ad8 commit 72050f9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎packages/vite/src/node/plugins/resolve.ts

+5
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,11 @@ export function resolvePlugin(resolveOptions: InternalResolveOptions): Plugin {
382382
`externalized node built-in "${id}" to empty module. ` +
383383
`(imported by: ${colors.white(colors.dim(importer))})`,
384384
)
385+
} else if (isProduction) {
386+
this.warn(
387+
`Module "${id}" has been externalized for browser compatibility, imported by "${importer}". ` +
388+
`See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.`,
389+
)
385390
}
386391
return isProduction
387392
? browserExternalId

0 commit comments

Comments
 (0)
Please sign in to comment.