Skip to content

使用vite构建项目出现错误,导致无法进行(使用electron-vite初始的项目) #8261

Closed
@carpONE

Description

@carpONE
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.6

Environment

windows11,vue3.5.13,vite6.2.6,electron-vite3.1.0

Reproduction link

https://cn.electron-vite.org/guide/#%E6%90%AD%E5%BB%BA%E7%AC%AC%E4%B8%80%E4%B8%AA-electron-vite-%E9%A1%B9%E7%9B%AE

Steps to reproduce

1、通过electron-vite初始项目
2、在renderer/src目录下的main.ts正常添加ant-design-vue
3、通过npm run build && electron-builder --win进行构建项目

What is expected?

希望是成功的状态

What is actually happening?

构建时出现如下错误:error during build: [vite]: Rollup failed to resolve import "@ant-design/icons-svg/es/asn/CloseOutlined" from "E:\myProject\electron-vite-vue\node_modules\@ant-design\icons-vue\es\icons\CloseOutlined.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 tobuild.rollupOptions.external

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions