File tree Expand file tree Collapse file tree 4 files changed +8
-24
lines changed Expand file tree Collapse file tree 4 files changed +8
-24
lines changed Original file line number Diff line number Diff line change @@ -182,9 +182,11 @@ export async function createMarkdown(options: ResolvedOptions) {
182
182
scriptLines . push ( 'defineExpose({ frontmatter })' )
183
183
184
184
if ( ! isVue2 && headEnabled && head ) {
185
+ // @ts -expect-error legacy option
186
+ if ( headEnabled === 'vueuse' )
187
+ throw new Error ( 'unplugin-vue-markdown no longer supports @vueuse/head. Change `headEnabled` to `true` and install `@unhead/vue` instead.' )
185
188
scriptLines . push ( `const head = ${ JSON . stringify ( head ) } ` )
186
- const importFrom = headEnabled === 'unhead' ? '@unhead/vue' : '@vueuse/head'
187
- scriptLines . unshift ( `import { useHead } from "${ importFrom } "` )
189
+ scriptLines . unshift ( `import { useHead } from "@unhead/vue"` )
188
190
scriptLines . push ( 'useHead(head)' )
189
191
}
190
192
Original file line number Diff line number Diff line change 1
1
import type { Options , ResolvedOptions } from '../types'
2
- import { getVueVersion , isUnheadVueInstalled } from './utils'
2
+ import { getVueVersion } from './utils'
3
3
4
4
export function resolveOptions ( userOptions : Options ) : ResolvedOptions {
5
5
const defaultOptions : ResolvedOptions = {
@@ -36,8 +36,5 @@ export function resolveOptions(userOptions: Options): ResolvedOptions {
36
36
...userOptions ,
37
37
}
38
38
39
- if ( options . headEnabled === true )
40
- options . headEnabled = isUnheadVueInstalled ( ) ? 'unhead' : 'vueuse'
41
-
42
39
return options as ResolvedOptions
43
40
}
Original file line number Diff line number Diff line change @@ -15,13 +15,3 @@ export function getVueVersion(defaultVersion = '3.2.0') {
15
15
return defaultVersion
16
16
}
17
17
}
18
-
19
- export function isUnheadVueInstalled ( ) {
20
- try {
21
- _require ( '@unhead/vue' )
22
- return true
23
- }
24
- catch {
25
- return false
26
- }
27
- }
Original file line number Diff line number Diff line change @@ -51,12 +51,9 @@ export interface Options {
51
51
/**
52
52
* Enable head support, need to install @unhead/vue and register to App in main.js
53
53
*
54
- * When `true` is passed, @unhead/vue will be used if installed.
55
- * If not, @vueuse/head will be used.
56
- *
57
- * @default false
54
+ * @default true
58
55
*/
59
- headEnabled ?: boolean | 'unhead' | 'vueuse'
56
+ headEnabled ?: boolean
60
57
61
58
/**
62
59
* The head field in frontmatter used to be used for @unhead/vue
@@ -197,9 +194,7 @@ export interface Options {
197
194
exclude ?: FilterPattern
198
195
}
199
196
200
- export interface ResolvedOptions extends Required < Options > {
201
- headEnabled : 'unhead' | 'vueuse' | false
202
- }
197
+ export interface ResolvedOptions extends Required < Options > { }
203
198
204
199
export interface MarkdownEnv extends MarkdownItEnv {
205
200
id : string
You can’t perform that action at this time.
0 commit comments