According to Arco design tutorial on the official website
Load components on demand by manual import
Solution:
Change the official website example to the following. The exclude array is the component name without CSS. If you are not clear about the component name, you can print console.log of the resolveStyle function:
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
[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?
Read More:
- [Solved] Vue item packaging error: Failed to load resource: the server responded with a status of 404 (Not Found)
- [Solved] vue3vite Error: Failed to resolve import “@vue/server-renderer from “src\App.vue“. Does the file exist
- [Solved] Vite Error: Failed to load module script: Expected a JavaScript module script but the server…
- [Solved] Vite packing error: some chunks are larger than 500kb after minification
- [Solved] Failed to load plugin ‘vue‘ declared in ‘.eslintrc.js‘: createRequire is not a function
- [Solved] Some chunks are bigger warning on vite packaging
- Vue3 + vite install element-plus error [How to Solve]
- [Solved] Vue calls style loader error: Module build failed: CssSyntaxError
- [Solved] Temporary error: Error: spawn E:\vue3-vite\my-app\node_modules\esbuild\esbuild.exe ENOENT
- [Solved] Vue binding dynamic inline style Error: transform:rotate()
- How to Solve Vite package error
- Please transfer a valid prop path to form item
- Vue Import element-plus Error: Failed to resolve import “element-pluslibtheme-chalkindex.css“ from “src
- [Solved] vite package Error: globalThis is not defined
- [Solved] vite2+vue3 jsx Error: React is not defined
- Ant design vue table Error: h is not defined [How to Solve]
- ‘webpack dev server’ is not an internal or external command, nor is it a runnable program or batch file. Solution: error in cnpm run dev:
- [Solved] webpack Package Error: TypeError: this.getOptions is not a function style-loader
- Method of identifying vite alias path by idea webstorm
- After Vite starts, it will prompt “network: use ` — host ` to expose”, and the service cannot be accessed through network IP