We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
vitejs
Learn more about funding links in repositories.
Report abuse
1 parent d428e7e commit ebfaa7eCopy full SHA for ebfaa7e
packages/vite/src/node/plugins/asset.ts
@@ -204,6 +204,7 @@ export function assetPlugin(config: ResolvedConfig): Plugin {
204
config.command === 'build' && this.getModuleInfo(id)?.isEntry
205
? 'no-treeshake'
206
: false,
207
+ meta: config.command === 'build' ? { 'vite:asset': true } : undefined,
208
}
209
},
210
@@ -230,7 +231,8 @@ export function assetPlugin(config: ResolvedConfig): Plugin {
230
231
chunk.type === 'chunk' &&
232
chunk.isEntry &&
233
chunk.moduleIds.length === 1 &&
- config.assetsInclude(chunk.moduleIds[0])
234
+ config.assetsInclude(chunk.moduleIds[0]) &&
235
+ this.getModuleInfo(chunk.moduleIds[0])?.meta['vite:asset']
236
) {
237
delete bundle[file]
238
0 commit comments