Skip to content

Commit

Permalink
Fix serving images referenced from app directory (#49236)
Browse files Browse the repository at this point in the history
### What?

Fixes serving images that are referenced by JS files inside the `/app`
directory.

### Why?

### How?

The `NextImageContentSource` attempts to fetch the image out of it's
inner content source, and before we were only providing it with the
`/public` and `/pages` directory's respective sources.

Re: https://vercel.slack.com/archives/C046HAU4H7F/p1683220799917649
  • Loading branch information
jridgewell committed May 4, 2023
1 parent 12a6827 commit d24f506
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/next-swc/crates/next-dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,7 @@ async fn source(
let main_source = main_source.into();
let source_maps = SourceMapContentSourceVc::new(main_source).into();
let source_map_trace = NextSourceMapTraceContentSourceVc::new(main_source).into();
let img_source = NextImageContentSourceVc::new(
CombinedContentSourceVc::new(vec![static_source, page_source]).into(),
)
.into();
let img_source = NextImageContentSourceVc::new(main_source).into();
let router_source = NextRouterContentSourceVc::new(
main_source,
execution_context,
Expand Down

0 comments on commit d24f506

Please sign in to comment.