–>

Rollup failed to resolve import “element-plus/es/components” from “node_modules/element-plus/es/index.js”.

今天打包的时候出现了错误

Rollup failed to resolve import "element-plus/es/components" from "node_modules/element-plus/es/index.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

暂不知道出现的原因和原理

解决方法,在vite.config中添加build

build: {
    rollupOptions: {
      external: [
        "element-plus", 
      ],
    },
  },
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐