diff --git a/test/e2e/app-dir/app-external/node_modules/conditional-exports-optout/package.json b/test/e2e/app-dir/app-external/node_modules/conditional-exports-optout/package.json index 3355c20aad28a2..2a2cb8619af5d1 100644 --- a/test/e2e/app-dir/app-external/node_modules/conditional-exports-optout/package.json +++ b/test/e2e/app-dir/app-external/node_modules/conditional-exports-optout/package.json @@ -11,7 +11,8 @@ "default": "./subpath.js" }, "./react": { - "import": "./react.js" + "import": "./react.mjs", + "default": "./react.js" }, "./package.json": "./package.json" } diff --git a/test/e2e/app-dir/app-external/node_modules/conditional-exports-optout/react.js b/test/e2e/app-dir/app-external/node_modules/conditional-exports-optout/react.js index 4f2c2283ed693b..106488bacc46e7 100644 --- a/test/e2e/app-dir/app-external/node_modules/conditional-exports-optout/react.js +++ b/test/e2e/app-dir/app-external/node_modules/conditional-exports-optout/react.js @@ -1,5 +1,7 @@ -import React from 'react' +const React = require('react') -export function getReactVersion() { +function getReactVersion() { return React.version } + +exports.getReactVersion = getReactVersion diff --git a/test/e2e/app-dir/app-external/node_modules/conditional-exports-optout/react.mjs b/test/e2e/app-dir/app-external/node_modules/conditional-exports-optout/react.mjs new file mode 100644 index 00000000000000..4f2c2283ed693b --- /dev/null +++ b/test/e2e/app-dir/app-external/node_modules/conditional-exports-optout/react.mjs @@ -0,0 +1,5 @@ +import React from 'react' + +export function getReactVersion() { + return React.version +} diff --git a/test/turbopack-tests-manifest.json b/test/turbopack-tests-manifest.json index 6499b757483ef5..6316f60a7d0fb6 100644 --- a/test/turbopack-tests-manifest.json +++ b/test/turbopack-tests-manifest.json @@ -2590,6 +2590,7 @@ "app dir - external dependency react in external esm packages should use the same react in server app", "app dir - external dependency server actions should compile server actions from node_modules in client components", "app dir - external dependency server actions should not prefer to resolve esm over cjs for bundling optout packages", + "app dir - external dependency should be able to opt-out 3rd party packages being bundled in server components", "app dir - external dependency should correctly collect global css imports and mark them as side effects", "app dir - external dependency should emit cjs helpers for external cjs modules when compiled", "app dir - external dependency should export client module references in esm", @@ -2606,7 +2607,6 @@ "app dir - external dependency should use the same export type for packages in both ssr and client" ], "failed": [ - "app dir - external dependency should be able to opt-out 3rd party packages being bundled in server components", "app dir - external dependency should not apply swc optimizer transform for external packages in browser layer in web worker" ], "pending": [],