@@ -19,9 +19,13 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19
19
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR
20
20
*/
21
21
// This file is https://github.com/jamiebuilds/react-loadable/blob/master/src/babel.js
22
- // Modified to also look for `next/dynamic`
23
- // Modified to put `webpack` and `modules` under `loadableGenerated` to be backwards compatible with next/dynamic which has a `modules` key
24
- // Modified to support `dynamic(import('something'))` and `dynamic(import('something'), options)
22
+ // - Modified to also look for `next/dynamic`
23
+ // - Modified to put `webpack` and `modules` under `loadableGenerated` to be
24
+ // backwards compatible with next/dynamic which has a `modules` key
25
+ // - Modified to support `dynamic(import('something'))` and
26
+ // `dynamic(import('something'), options)
27
+ // - Removed `Loadable.Map` support, `next/dynamic` uses overloaded arguments
28
+ // instead of a separate API
25
29
26
30
import type {
27
31
NodePath ,
@@ -60,20 +64,6 @@ export default function ({
60
64
61
65
binding . referencePaths . forEach ( ( refPath ) => {
62
66
let callExpression = refPath . parentPath
63
-
64
- if (
65
- callExpression ?. isMemberExpression ( ) &&
66
- callExpression . node . computed === false
67
- ) {
68
- const property = callExpression . get ( 'property' )
69
- if (
70
- ! Array . isArray ( property ) &&
71
- property . isIdentifier ( { name : 'Map' } )
72
- ) {
73
- callExpression = callExpression . parentPath
74
- }
75
- }
76
-
77
67
if ( ! callExpression ?. isCallExpression ( ) ) return
78
68
79
69
let args = callExpression . get ( 'arguments' )
0 commit comments