Skip to content

使用相对路径打包远端组件后,宿主端请求js或者css路径有误 #706

@CasbaL

Description

@CasbaL

Versions

  • vite-plugin-federation: 1.4.1
  • vite: 6.3.5

Reproduction

https://github.com/CasbaL/vite-plugin-bug-demo

Additional Details
1. 默认vite会把remoteEntry.js和组件的js放在同一层级即assets下;但是通过remoteEntry.js请求的组件js文件会自动再加上一个assets层级,导致js请求失败 2. 将remoteEntry.js提到根路径后,css请求路径又会少一层assets

Steps to reproduce

分别切换到 d9bc10dd5712758565c2607ec06d1b36e9b7734e 和 7b298ed70a19db83a604d6feea553b1018a64b03 可以复现两种情况的问题

What is Expected?

可以正常请求到资源

What is actually happening?

资源路径拼接异常

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