Sets main path in the package.json to use lib instead of scripts.
The following code:
import { controls } from 'react-media-player';
Throws this error:
Module not found: Error: Cannot resolve module 'react-media-player' in
/Users/aaron/workspace/work/apps/disc/components/opinion/webpack/components
@ ./webpack/components/StimulusPlayer.js 13:24-53
I'm forced to use:
import { controls } from 'react-media-player/lib/react-media-player.js';
It doesn't look like the project is has an index.js where you export the objects you want.
It looks like the main directive in the package.json is wrong:
"main": "scripts/react-media-player.js",
Changing the package.json to point to lib/react-media-player.js fixes the issue.
Sets main path in the package.json to use lib instead of scripts.
The following code:
Throws this error:
I'm forced to use:
It doesn't look like the project is has an
index.js
where you export the objects you want. It looks like themain
directive in thepackage.json
is wrong:Changing the
package.json
to point tolib/react-media-player.js
fixes the issue.