Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 6e4a025

Browse files
committed
fix: properly handle non-script src imports
1 parent 1787958 commit 6e4a025

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: src/index.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ export default function PluginVue(userOptions: Partial<Options> = {}): Plugin {
9292
})
9393
if (resolved) {
9494
cache.set(resolved.id, getDescriptor(importer!))
95+
const [, originalQuery] = id.split('?', 2)
96+
resolved.id += `?${originalQuery}`
97+
return resolved
9598
}
96-
return resolved
9799
} else if (!filter(query.filename)) {
98100
return undefined
99101
}
@@ -137,7 +139,7 @@ export default function PluginVue(userOptions: Partial<Options> = {}): Plugin {
137139
async transform(code, id) {
138140
const query = parseVuePartRequest(id)
139141
if (query.vue) {
140-
if (!filter(query.filename)) return null
142+
if (!query.src && !filter(query.filename)) return null
141143

142144
const descriptor = getDescriptor(query.filename)
143145
const hasScoped = descriptor.styles.some((s) => s.scoped)

0 commit comments

Comments
 (0)