File tree Expand file tree Collapse file tree 8 files changed +34
-1
lines changed
unit/module-sync-condition-es-nested Expand file tree Collapse file tree 8 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,11 @@ async function resolveExportsImports(
254254 ) {
255255 const fallbackCondition =
256256 'require' in exportsForSubpath ? 'require' : 'default' ;
257- const fallbackTarget = exportsForSubpath [ fallbackCondition ] ;
257+ const fallbackTarget = getExportsTarget (
258+ exportsForSubpath [ fallbackCondition ] ,
259+ job . conditions ,
260+ cjsResolve ,
261+ ) ;
258262 if (
259263 typeof fallbackTarget === 'string' &&
260264 fallbackTarget . startsWith ( './' )
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ const skipOnMac = [];
2828const skipOnNode20AndBelow = [
2929 'module-sync-condition-es' ,
3030 'module-sync-condition-cjs' ,
31+ 'module-sync-condition-es-nested' ,
3132 'imports-module-sync' ,
3233 'imports-module-sync-cjs' ,
3334 'self-reference-module-sync' ,
Original file line number Diff line number Diff line change 1+ export const test = 'fallback version' ;
Original file line number Diff line number Diff line change 1+ export const test = 'import version' ;
Original file line number Diff line number Diff line change 1+ import { test } from 'test-pkg-sync-es' ;
2+ console . log ( test ) ;
Original file line number Diff line number Diff line change 1+ export const test = 'module-sync version' ;
Original file line number Diff line number Diff line change 1+ [
2+ "test/unit/module-sync-condition-es-nested/fallback.js" ,
3+ "test/unit/module-sync-condition-es-nested/input.js" ,
4+ "test/unit/module-sync-condition-es-nested/module-sync.js" ,
5+ "test/unit/module-sync-condition-es-nested/package.json"
6+ ]
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " test-pkg-sync-es" ,
3+ "type" : " module" ,
4+ "exports" : {
5+ "." : {
6+ "module-sync" : {
7+ "default" : " ./module-sync.js"
8+ },
9+ "import" : {
10+ "default" : " ./import.js"
11+ },
12+ "default" : {
13+ "default" : " ./fallback.js"
14+ }
15+ }
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments