Skip to content

Commit

Permalink
fix ASSET_PREFIX (#7750)
Browse files Browse the repository at this point in the history
### Description

The default for asset prefix is `"/"` and not `""`

### Testing Instructions

vercel/next.js#62134
  • Loading branch information
sokra authored Mar 19, 2024
1 parent 9f45b5b commit d0275e0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
10 changes: 3 additions & 7 deletions crates/turbopack-nodejs/src/ecmascript/node/entry/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,8 @@ impl EcmascriptBuildNodeRuntimeChunk {

let mut code = CodeBuilder::default();
let output_root = output_root.to_string();
let asset_prefix = this
.chunking_context
.asset_prefix()
.await?
.clone_value()
.unwrap_or("".to_string());
let asset_prefix = this.chunking_context.asset_prefix().await?;
let asset_prefix = asset_prefix.as_deref().unwrap_or("/");

writedoc!(
code,
Expand All @@ -65,7 +61,7 @@ impl EcmascriptBuildNodeRuntimeChunk {
"#,
StringifyJs(runtime_public_path),
StringifyJs(output_root.as_str()),
StringifyJs(asset_prefix.as_str()),
StringifyJs(asset_prefix),
)?;

match this.chunking_context.await?.runtime_type() {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d0275e0

Please sign in to comment.