File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -963,8 +963,11 @@ function vitePluginUseClient(
963963 let importId : string
964964 let referenceKey : string
965965 const packageSource = packageSources . get ( id )
966- if ( ! packageSource && id . includes ( '/node_modules/' ) ) {
967- assert ( this . environment . mode === 'dev' )
966+ if (
967+ ! packageSource &&
968+ this . environment . mode === 'dev' &&
969+ id . includes ( '/node_modules/' )
970+ ) {
968971 // If non package source reached here (often with ?v=... query), this is a client boundary
969972 // created by a package imported on server environment, which breaks the
970973 // expectation on dependency optimizer on browser. Directly copying over
@@ -1225,8 +1228,10 @@ function vitePluginUseServer(
12251228 let normalizedId_ : string | undefined
12261229 const getNormalizedId = ( ) => {
12271230 if ( ! normalizedId_ ) {
1228- if ( id . includes ( '/node_modules/' ) ) {
1229- assert ( this . environment . mode === 'dev' )
1231+ if (
1232+ this . environment . mode === 'dev' &&
1233+ id . includes ( '/node_modules/' )
1234+ ) {
12301235 const ignored =
12311236 useServerPluginOptions . ignoredPackageWarnings ?. some (
12321237 ( pattern ) =>
You can’t perform that action at this time.
0 commit comments