Skip to content

Commit

Permalink
Revert "Revert "feat(turbopack): support next.js specific node polyfi…
Browse files Browse the repository at this point in the history
…lls" (#55385)"

This reverts commit 9953db4.
  • Loading branch information
sokra authored Sep 14, 2023
1 parent 724ece8 commit 2b2a45b
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 192 deletions.
6 changes: 6 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 @@ -661,6 +661,12 @@ pub async fn insert_next_shared_aliases(
import_map.insert_singleton_alias("react", project_path);
import_map.insert_singleton_alias("react-dom", project_path);

//https://github.com/vercel/next.js/blob/f94d4f93e4802f951063cfa3351dd5a2325724b3/packages/next/src/build/webpack-config.ts#L1196
import_map.insert_exact_alias(
"setimmediate",
request_to_import_mapping(project_path, "next/dist/compiled/setimmediate"),
);

insert_turbopack_dev_alias(import_map);
insert_package_alias(
import_map,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 12 additions & 0 deletions test/development/basic/node-builtins/app/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const metadata = {
title: 'Next.js',
description: 'Generated by Next.js',
}

export default function RootLayout({ children }) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}
1 change: 1 addition & 0 deletions test/turbopack-tests-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const enabledTests = [
'test/development/basic/emotion-swc.test.ts',
'test/development/basic/legacy-decorators.test.ts',
'test/development/basic/misc.test.ts',
'test/development/basic/node-builtins.test.ts',
'test/development/basic/next-rs-api.test.ts',
'test/development/basic/tailwind-jit.test.ts',
'test/development/basic/theme-ui.test.ts',
Expand Down

0 comments on commit 2b2a45b

Please sign in to comment.