fix(build): ship built-in vue-demi to avoid resolution issues (#3680)

pull/3682/head
Divyansh Singh 6 months ago committed by GitHub
parent 05061bd3d2
commit 5d3cb96ac3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,34 @@
/**
* vue-demi v0.14.7
* Copyright (c) 2020-present, Anthony Fu
* @license MIT
*/
import * as Vue from 'vue'
var isVue2 = false
var isVue3 = true
var Vue2 = undefined
function install() {}
export function set(target, key, val) {
if (Array.isArray(target)) {
target.length = Math.max(target.length, key)
target.splice(key, 1, val)
return val
}
target[key] = val
return val
}
export function del(target, key) {
if (Array.isArray(target)) {
target.splice(key, 1)
return
}
delete target[key]
}
export * from 'vue'
export { Vue, Vue2, isVue2, isVue3, install }

@ -24,6 +24,9 @@
"./theme-without-fonts": { "./theme-without-fonts": {
"types": "./theme-without-fonts.d.ts", "types": "./theme-without-fonts.d.ts",
"default": "./dist/client/theme-default/without-fonts.js" "default": "./dist/client/theme-default/without-fonts.js"
},
"./vue-demi": {
"default": "./lib/vue-demi.mjs"
} }
}, },
"bin": { "bin": {
@ -36,7 +39,8 @@
"template", "template",
"client.d.ts", "client.d.ts",
"theme.d.ts", "theme.d.ts",
"theme-without-fonts.d.ts" "theme-without-fonts.d.ts",
"lib"
], ],
"repository": { "repository": {
"type": "git", "type": "git",

@ -41,6 +41,10 @@ export function resolveAliases(
{ {
find: /^vitepress\/theme$/, find: /^vitepress\/theme$/,
replacement: join(DIST_CLIENT_PATH, '/theme-default/index.js') replacement: join(DIST_CLIENT_PATH, '/theme-default/index.js')
},
{
find: /^vue-demi$/,
replacement: require.resolve('vitepress/vue-demi')
} }
] ]

Loading…
Cancel
Save