diff --git a/src/index.ts b/src/index.ts index 32eb2fe..8472437 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 } diff --git a/src/utils/query.ts b/src/utils/query.ts index 9218443..a012be0 100644 --- a/src/utils/query.ts +++ b/src/utils/query.ts @@ -6,6 +6,7 @@ export interface VueQuery { type?: 'script' | 'template' | 'style' | 'custom' index?: number lang?: string + raw?: boolean } export function parseVueRequest(id: string) { @@ -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,