Skip to content

Commit

Permalink
Fix single player import logic
Browse files Browse the repository at this point in the history
Passing through the player directly meant `key` couldn’t be used for the clever config merging
Fixes cookpete/react-player#993
  • Loading branch information
philip-luther committed Nov 22, 2024
1 parent 0c27950 commit 50128f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/pre-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ const generateSinglePlayers = async () => {
const file = `
const createReactPlayer = require('./lib/ReactPlayer').createReactPlayer
const Player = require('./lib/players/${name}').default
module.exports = createReactPlayer([Player])
module.exports = createReactPlayer([{
key: '${key}',
canPlay: Player.canPlay,
lazyPlayer: Player
}])
`
await writeFile(join('.', `${key}.js`), file)
}
Expand Down

0 comments on commit 50128f4

Please sign in to comment.