formilyjs/element-plus

Failed to resolve import "element-plus/es/components/default/style/css.js"

help-lixin opened this issue · 1 comments

=============================package.json=============================
"dependencies": {
"@formily/core": "^2.3.0",
"@formily/element-plus": "^1.1.0-beta.0",
"@formily/vue": "^2.3.0",
"element-plus": "^2.4.2",
"moment": "^2.29.4",
"sass": "^1.32.11",
"sass-loader": "^8.0.2",
"vue": "^3.3.4"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.2.3",
"sass": "^1.49.9",
"unplugin-auto-import": "^0.16.7",
"unplugin-vue-components": "^0.25.2",
"vite": "^4.4.0",
"vite-plugin-imp": "^2.4.0"
}

=============================vite.config.js=============================
vitePluginImp({
libList: [
{
libName: '@formily/element-plus',
libDirectory: 'esm',
replaceOldImport : false,
style(name) {
return @formily/element-plus/esm/${name}/style.js
},
},
],
}),

=============================package.json=============================
import 'element-plus/theme-chalk/src/base.scss'

=============================启动访问报错=============================

[vite] Internal server error: Failed to resolve import "element-plus/es/components/default/style/css.js" from "src/main.js". Does the file exist?
Plugin: vite:import-analysis
File: /Users/xxx/Desktop/bpmn-vue3-custom/src/main.js:1:9
1 | import 'element-plus/es/components/default/style/css.js';;i

Hello @help-lixin, your issue has been closed because it does not conform to our issue requirements. Please use the Issue Helper to create an issue, thank you!
你好 @help-lixin,为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 issue 助手 来创建 issue 以方便我们定位错误。谢谢配合!