According to the official arco design tutorial:

Manually import components on demand

Solution:

Modify the official website example as follows, the exclude array contains the names of components without CSS. If you are not sure about the component names, you can print them in the resolveStyle function using console.log.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
createStyleImportPlugin({
libs: [
{
libraryName: '@arco-design/web-vue',
esModule: true,
resolveStyle: (name) => {
const exclude = ['menu-item']
if (exclude.includes(name)) return ''
// css
return `@arco-design/web-vue/es/${name}/style/css.js`
},
},
],
}),

Error message:

1
[vite] Internal server error: Failed to resolve import "D:/Programing/WebstormProjects/cow-Low-code/node_modules/@arco-design/web-vue/es/menu-item/style/css.js" from "src\views\HomeView.vue". Does the file exist?

16936515375371693651537473.png