File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 "main" : " ./dist/react-intersection-observer.js" ,
77 "module" : " ./dist/react-intersection-observer.mjs" ,
88 "exports" : {
9- "require" : " ./dist/react-intersection-observer.js" ,
10- "default" : " ./dist/react-intersection-observer.modern.mjs" ,
11- "test-utils" : " ./dist/test-utils.js"
9+ "./test-utils" : " ./test-utils.js" ,
10+ "." : {
11+ "import" : " ./react-intersection-observer.modern.mjs" ,
12+ "require" : " ./react-intersection-observer.js"
13+ }
1214 },
1315 "unpkg" : " ./dist/react-intersection-observer.umd.js" ,
1416 "typings" : " ./dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -42,7 +42,17 @@ fields.forEach((key) => {
4242 if ( typeof pck [ key ] === 'object' ) {
4343 const keys = Object . keys ( pck [ key ] ) ;
4444 keys . forEach ( ( subkey ) => {
45- pck [ key ] [ subkey ] = pck [ key ] [ subkey ] ?. replace ( './dist/' , './' ) ;
45+ if ( typeof pck [ key ] [ subkey ] === 'string' ) {
46+ pck [ key ] [ subkey ] = pck [ key ] [ subkey ] ?. replace ( './dist/' , './' ) ;
47+ } else if ( typeof pck [ key ] [ subkey ] === 'object' ) {
48+ const sub = pck [ key ] [ subkey ] ;
49+ const subkeys = Object . keys ( sub ) ;
50+ subkeys . forEach ( ( subsubkey ) => {
51+ if ( typeof sub [ subsubkey ] === 'string' ) {
52+ sub [ subsubkey ] = sub [ subsubkey ] ?. replace ( './dist/' , './' ) ;
53+ }
54+ } ) ;
55+ }
4656 } ) ;
4757 } else {
4858 pck [ key ] = pck [ key ] ?. replace ( './dist/' , './' ) ;
You can’t perform that action at this time.
0 commit comments