Closed Charles7c closed 2 years ago
Before, Arco was introduced in the way of Element Plus, dev running style and so on was fine, but errors were reported during build. https://github.com/Charles7c/charles7c.github.io/runs/7702184010?check_suite_focus=true
Things seem to be working fine in your latest code except for some reason your global components aren't getting registered. Removing them, the build succeeds.
It's a headache. I'm a back-end developer. I hope I can get your help. :)
.vitepress/theme/index.ts
import DefaultTheme from 'vitepress/theme'
import MyLayout from "./MyLayout.vue"
import ArcoVue from '@arco-design/web-vue'
import '@arco-design/web-vue/dist/arco.css'
import './styles/vars.css'
import './styles/custom.css'
import ArticleMetadata from './components/ArticleMetadata.vue'
import Tag from './components/Tag.vue'
import Archive from './components/Archive.vue'
export default {
...DefaultTheme,
Layout: MyLayout,
enhanceApp({ app }) {
// 全局注册ArcoDesignVue
app.use(ArcoVue)
app.component('ArticleMetadata', ArticleMetadata)
app.component('Tag', Tag)
app.component('Archive', Archive)
}
}
I actually needed to introduce arco in its entirety, but I got an error building.
Can you write an example similar to the vitepress-element-plus-demo
?
vitepress-arco-design-vue-demo
, yarn dev and yarn build without error.
Can you write an example similar to the vitepress-element-plus-demo? vitepress-arco-design-vue-demo, yarn dev and yarn build without error.
https://github.com/brc-dd/vitepress-arco-design-vue-demo
I actually needed to introduce arco in its entirety
This isn't recommended though. Even in my example you'll see very large chunks being generated.
Thank you, I have seen that I also configured like this, but it still reported an error. Is it because I use icons alone?
oky! I deleted all my files, then added them little by little, tried dev and build again and again, and finally the problem was found to be the use of icons. https://github.com/Charles7c/charles7c.github.io/blob/main/repos/.vitepress/theme/components/Archive.vue
I'll find out how to use its icon. thank you.
Could you please help me check where the configuration is wrong? Thank you!