Skip to content

Commit 122223e

Browse files
committed
wip: full bundle dev env
1 parent 7e091e0 commit 122223e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/vite/src/node/server/environments/fullBundleEnvironment.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type { ResolvedConfig } from '../../config'
1313
import type { ViteDevServer } from '../../server'
1414
import { arraify, createDebugger } from '../../utils'
1515
import { prepareError } from '../middlewares/error'
16+
import { getShortName } from '../hmr'
1617

1718
const debug = createDebugger('vite:full-bundle-mode')
1819

@@ -412,20 +413,21 @@ export class FullBundleDevEnvironment extends DevEnvironment {
412413
) {
413414
if (hmrOutput.type === 'Noop') return
414415

416+
const shortFile = getShortName(file, this.config.root)
415417
if (hmrOutput.type === 'FullReload') {
416418
this.triggerGenerateBundle({ options, bundle })
417419

418420
const reason = hmrOutput.reason
419421
? colors.dim(` (${hmrOutput.reason})`)
420422
: ''
421423
this.logger.info(
422-
colors.green(`trigger page reload `) + colors.dim(file) + reason,
424+
colors.green(`trigger page reload `) + colors.dim(shortFile) + reason,
423425
{ clear: !firstInvalidatedBy, timestamp: true },
424426
)
425427
return
426428
}
427429

428-
debug?.(`handle hmr output for ${file}`, {
430+
debug?.(`handle hmr output for ${shortFile}`, {
429431
...hmrOutput,
430432
code: typeof hmrOutput.code === 'string' ? '[code]' : hmrOutput.code,
431433
})

0 commit comments

Comments
 (0)