Unverified Commit 935a66de authored by Vladik Tarasov's avatar Vladik Tarasov Committed by GitHub

react-loadable-plugin. Handle undefined opts.caller (#25264)


`caller` - in babel is optional field - https://babeljs.io/docs/en/options#caller

And it may be not provided by developer in transformFile

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
parent c0a07aa9
...@@ -151,7 +151,7 @@ export default function ({ ...@@ -151,7 +151,7 @@ export default function ({
t.binaryExpression( t.binaryExpression(
'+', '+',
t.stringLiteral( t.stringLiteral(
(state.file.opts.caller.pagesDir (state.file.opts.caller?.pagesDir
? relativePath( ? relativePath(
state.file.opts.caller.pagesDir, state.file.opts.caller.pagesDir,
state.file.opts.filename state.file.opts.filename
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment