We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7288a59 commit 8204fceCopy full SHA for 8204fce
packages/plugin-vue/src/index.ts
@@ -201,6 +201,8 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
201
: createFilter(customElement)
202
})
203
204
+ let transformCachedModule = false
205
+
206
return {
207
name: 'vite:vue',
208
@@ -277,6 +279,17 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
277
279
!config.isProduction
278
280
),
281
}
282
+ transformCachedModule =
283
+ config.command === 'build' &&
284
+ options.value.sourceMap &&
285
+ config.build.watch != null
286
+ },
287
288
+ shouldTransformCachedModule({ id }) {
289
+ if (transformCachedModule && parseVueRequest(id).query.vue) {
290
+ return true
291
+ }
292
+ return false
293
},
294
295
configureServer(server) {
0 commit comments