Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/vite/src/node/plugins/importAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,13 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
if (ssr) {
return [url, null]
}

// Check if the module is marked as external before throwing an error
const externalArray = environment.config.resolve.external
if (Array.isArray(externalArray) && externalArray.includes(url)) {
return [url, null]
}

// fix#9534, prevent the importerModuleNode being stopped from propagating updates
importerModule.isSelfAccepting = false
moduleGraph._hasResolveFailedErrorModules.add(importerModule)
Expand Down
Loading
Loading