同 上一篇文章,vitepress builld报错 遇到的问题是一样的,只是vuepress的报错是global is not defined;
解决方法:
enhanceApp.js文件
export default async({Vue})=> {
...其他配置
if (typeof process === 'undefined') {
if (typeof window !== 'undefined'){
window.global = window;
const myUI = require('自己的组件库地址').default;
Vue.use(myUI);
}
}
}