Skip to content

Commit

Permalink
Make caller optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Tarasov committed May 19, 2021
1 parent 78b1735 commit b6fa6d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/next/build/babel/plugins/react-loadable-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,14 @@ export default function ({
Import(importPath) {
const importArguments = importPath.parentPath.get('arguments')
if (!Array.isArray(importArguments)) return

const node: any = importArguments[0].node
dynamicImports.push(node)
dynamicKeys.push(
t.binaryExpression(
'+',
t.stringLiteral(
(state.file.opts.caller.pagesDir
(state.file.opts.caller?.pagesDir
? relativePath(
state.file.opts.caller.pagesDir,
state.file.opts.filename
Expand Down

0 comments on commit b6fa6d1

Please sign in to comment.