File tree 1 file changed +5
-1
lines changed
packages/vite/src/node/plugins
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import { normalizePath, sortObjectKeys } from '../utils'
11
11
import { generatedAssets } from './asset'
12
12
import type { GeneratedAssetMeta } from './asset'
13
13
14
+ const endsWithJSRE = / \. [ c m ] ? j s $ /
15
+
14
16
export type Manifest = Record < string , ManifestChunk >
15
17
16
18
export interface ManifestChunk {
@@ -134,7 +136,9 @@ export function manifestPlugin(config: ResolvedConfig): Plugin {
134
136
135
137
// If JS chunk and asset chunk are both generated from the same source file,
136
138
// prioritize JS chunk as it contains more information
137
- if ( manifest [ src ] ?. file . endsWith ( '.js' ) ) continue
139
+ const file = manifest [ src ] ?. file
140
+ if ( file && endsWithJSRE . test ( file ) ) continue
141
+
138
142
manifest [ src ] = asset
139
143
fileNameToAsset . set ( chunk . fileName , asset )
140
144
}
You can’t perform that action at this time.
0 commit comments