Skip to content

Commit

Permalink
Turbopack: remap next/head on client in App Pages (vercel#55419)
Browse files Browse the repository at this point in the history
### What?

Remaps `next/head` to `next/dist/client/components/noop-head` on the client inside an App Page.

### Why?

Because webpack bundles do it.

### How?

We were just missing an import remap. 🤦 

Closes WEB-1573
  • Loading branch information
jridgewell authored Sep 15, 2023
1 parent 1e33253 commit 36afda4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/next-swc/crates/next-core/src/next_import_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ pub async fn get_next_client_import_map(
"react-server-dom-webpack/",
request_to_import_mapping(app_dir, "next/dist/compiled/react-server-dom-webpack/*"),
);
import_map.insert_exact_alias(
"next/head",
request_to_import_mapping(project_path, "next/dist/client/components/noop-head"),
);
import_map.insert_exact_alias(
"next/dynamic",
request_to_import_mapping(project_path, "next/dist/shared/lib/app-dynamic"),
Expand Down

0 comments on commit 36afda4

Please sign in to comment.