We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 833a7a6 commit b7b1383Copy full SHA for b7b1383
packages/plugin-vue/src/main.ts
@@ -1,4 +1,5 @@
1
import path from 'node:path'
2
+import fs from 'node:fs'
3
import type { SFCBlock, SFCDescriptor } from 'vue/compiler-sfc'
4
import type { PluginContext, TransformPluginContext } from 'rollup'
5
import type { RawSourceMap } from 'source-map'
@@ -39,8 +40,9 @@ export async function transformMain(
39
40
const prevDescriptor = getPrevDescriptor(filename)
41
const { descriptor, errors } = createDescriptor(filename, code, options)
42
- // set descriptor for HMR if it's not set yet
43
- getDescriptor(filename, options, true, true)
+ if (fs.existsSync(filename))
44
+ // set descriptor for HMR if it's not set yet
45
+ getDescriptor(filename, options, true, true)
46
47
if (errors.length) {
48
errors.forEach((error) =>
0 commit comments