Add import to to src/App.js:
import useScript from 'react-script-hook' or import useScript from 'react-script-hook/lib/use-script'
npm run build
Result:
...
Compiled with warnings.
Failed to parse source map from '/home/schwolf/dev/myApp/node_modules/react-script-hook/src/use-script.tsx' file: Error: ENOENT: no such file or directory, open '/home/schwolf/dev/myApp/node_modules/react-script-hook/src/use-script.tsx'
...
This problem did not occur in in create-react-app version 4 (which was using webpack v4 under the hood)
Steps to reproduce:
npx create-react-app myApp
cd myApp
npm i react-script-hook
Add import to to src/App.js:
import useScript from 'react-script-hook'
orimport useScript from 'react-script-hook/lib/use-script'
npm run build
Result: ... Compiled with warnings.
Failed to parse source map from '/home/schwolf/dev/myApp/node_modules/react-script-hook/src/use-script.tsx' file: Error: ENOENT: no such file or directory, open '/home/schwolf/dev/myApp/node_modules/react-script-hook/src/use-script.tsx' ...
This problem did not occur in in create-react-app version 4 (which was using webpack v4 under the hood)