Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 906cebb

Browse filesBrowse files
authored
fix(plugin-vue): resolve sourcemap conflicts in build watch mode with cached modules (#505)
1 parent 2704e85 commit 906cebb
Copy full SHA for 906cebb

File tree

Expand file treeCollapse file tree

1 file changed

+14
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-1
lines changed

‎packages/plugin-vue/src/index.ts

Copy file name to clipboardExpand all lines: packages/plugin-vue/src/index.ts
+14-1Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
201201
: createFilter(customElement)
202202
})
203203

204+
let transformCachedModule = false
205+
204206
return {
205207
name: 'vite:vue',
206208

@@ -294,7 +296,6 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
294296
!config.isProduction
295297
),
296298
}
297-
298299
// #507 suppress warnings for non-recognized pseudo selectors from lightningcss
299300
const _warn = config.logger.warn
300301
config.logger.warn = (...args) => {
@@ -308,6 +309,18 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
308309
}
309310
_warn(...args)
310311
}
312+
313+
transformCachedModule =
314+
config.command === 'build' &&
315+
options.value.sourceMap &&
316+
config.build.watch != null
317+
},
318+
319+
shouldTransformCachedModule({ id }) {
320+
if (transformCachedModule && parseVueRequest(id).query.vue) {
321+
return true
322+
}
323+
return false
311324
},
312325

313326
configureServer(server) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.