Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Commit

Permalink
feat: import vue file as raw correctly (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico Hoffmann committed May 7, 2021
1 parent 46b59b9 commit 175beb3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -139,7 +139,7 @@ export function createVuePlugin(rawOptions: VueViteOptions = {}): Plugin {
return transformVueJsx(code, id, options.jsxOptions)
}

if (!query.vue && !filter(filename)) {
if ((!query.vue && !filter(filename)) || query.raw) {
return
}

Expand Down
4 changes: 4 additions & 0 deletions src/utils/query.ts
Expand Up @@ -6,6 +6,7 @@ export interface VueQuery {
type?: 'script' | 'template' | 'style' | 'custom'
index?: number
lang?: string
raw?: boolean
}

export function parseVueRequest(id: string) {
Expand All @@ -20,6 +21,9 @@ export function parseVueRequest(id: string) {
if (query.index != null) {
query.index = Number(query.index)
}
if (query.raw != null) {
query.raw = true
}
return {
filename,
query,
Expand Down

0 comments on commit 175beb3

Please sign in to comment.