File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
import path from 'node:path'
2
+ import fs from 'node:fs'
2
3
import type { SFCBlock , SFCDescriptor } from 'vue/compiler-sfc'
3
4
import type { PluginContext , TransformPluginContext } from 'rollup'
4
5
import type { RawSourceMap } from 'source-map'
@@ -39,8 +40,9 @@ export async function transformMain(
39
40
const prevDescriptor = getPrevDescriptor ( filename )
40
41
const { descriptor, errors } = createDescriptor ( filename , code , options )
41
42
42
- // set descriptor for HMR if it's not set yet
43
- getDescriptor ( filename , options , true , true )
43
+ if ( fs . existsSync ( filename ) )
44
+ // set descriptor for HMR if it's not set yet
45
+ getDescriptor ( filename , options , true , true )
44
46
45
47
if ( errors . length ) {
46
48
errors . forEach ( ( error ) =>
You can’t perform that action at this time.
0 commit comments