File tree 1 file changed +5
-4
lines changed
packages/vite/src/node/plugins
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { promisify } from 'node:util'
4
4
import colors from 'picocolors'
5
5
import type { Plugin } from 'rollup'
6
6
import type { ResolvedConfig } from '../config'
7
- import { isDefined , normalizePath } from '../utils'
7
+ import { isDefined , isInNodeModules , normalizePath } from '../utils'
8
8
import { LogLevels } from '../logger'
9
9
10
10
const groups = [
@@ -122,9 +122,10 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
122
122
// the same chunk. The intersecting dynamic importers' dynamic import is not
123
123
// expected to work. Note we're only detecting the direct ineffective
124
124
// dynamic import here.
125
- if (
126
- module . dynamicImporters . some ( ( m ) => chunk . moduleIds . includes ( m ) )
127
- ) {
125
+ const detectedIneffectiveDynamicImport = module . dynamicImporters . some (
126
+ ( id ) => ! isInNodeModules ( id ) && chunk . moduleIds . includes ( id ) ,
127
+ )
128
+ if ( detectedIneffectiveDynamicImport ) {
128
129
this . warn (
129
130
`\n(!) ${
130
131
module . id
You can’t perform that action at this time.
0 commit comments