souporserious / react-media-player

React audio and video player.
https://souporserious.github.io/react-media-player/
ISC License
470 stars 100 forks source link

Allows standard module importing to work #3

Closed aaronmcadam closed 8 years ago

aaronmcadam commented 8 years ago

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.

aaronmcadam commented 8 years ago

@souporserious It looks like Travis isn't set up, is that expected?

souporserious commented 8 years ago

Thanks for fixing this, missed it before releasing. It's expected, that's my bad. I need to set up Travis still.