Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: should not append a trailing / when output.assetPrefix is empty string #3616

Closed
chenyuan-new opened this issue Sep 30, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@chenyuan-new
Copy link

Version

latest

Details

When set output.assetPrefix to '', the output publicPath starts with /.
Maybe it'll be better not to append a trailing / when assetPrefix is ''

Why would i set assetPrefix to '':

  • i want to set output.publicPath so in rsbuild i should set assetPrefix
  • Our project use <base> element to determine the soure path of js file, the href value is dynamically set when start docker

The source code related to this issue:
related code

Reproduce link

no

Reproduce Steps

no

@chenyuan-new chenyuan-new added the bug Something isn't working label Sep 30, 2024
@chenjiahan
Copy link
Member

You can set assetPrefix to ./, it is equivalent to ''.

Rsbuild should always add a trailing slash to output.assetPrefix. This ensures consistent behavior, and changing this behavior is a potential breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants