Skip to content

Commit e81c183

Browse files
authored
fix: unreachable error when building with experimental.bundledDev is enabled (#21296)
1 parent 98d9a33 commit e81c183

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/vite/src/node/plugins/asset.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,10 @@ async function fileToBuiltUrl(
468468
postfix = postfix.replace(noInlineRE, '').replace(/^&/, '?')
469469
}
470470

471-
if (environment.config.experimental.bundledDev) {
471+
if (
472+
environment.config.command === 'serve' &&
473+
environment.config.experimental.bundledDev
474+
) {
472475
const outputFilename = pluginContext.getFileName(referenceId)
473476
const outputUrl = toOutputFilePathInJS(
474477
environment,

0 commit comments

Comments
 (0)