Skip to content

Commit 269121e

Browse files
authored
feat(plugin-vue): expose options in api (#177)
1 parent b8dbcb4 commit 269121e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

packages/plugin-vue/src/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type {
1010
} from 'vue/compiler-sfc'
1111
import type * as _compiler from 'vue/compiler-sfc'
1212
/* eslint-enable import/no-duplicates */
13+
import { version } from '../package.json'
1314
import { resolveCompiler } from './compiler'
1415
import { parseVueRequest } from './utils/query'
1516
import { getDescriptor, getSrcDescriptor } from './utils/descriptorCache'
@@ -130,6 +131,16 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
130131
return {
131132
name: 'vite:vue',
132133

134+
api: {
135+
get options() {
136+
return options
137+
},
138+
set options(value) {
139+
options = value
140+
},
141+
version,
142+
},
143+
133144
handleHotUpdate(ctx) {
134145
if (options.compiler.invalidateTypeCache) {
135146
options.compiler.invalidateTypeCache(ctx.file)

packages/plugin-vue/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"noImplicitOverride": true,
1313
"noUnusedLocals": true,
1414
"esModuleInterop": true,
15-
"baseUrl": "."
15+
"baseUrl": ".",
16+
"resolveJsonModule": true
1617
}
1718
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy