const { join } = require('path')
const { writeFile } = require('fs').promises
const { default: players } = require('../lib/players')

const generateSinglePlayers = async () => {
  for (const { key, name } of players) {
    const file = `
      const { createReactPlayer } = require('./lib/ReactPlayer')
      const Player = require('./lib/players/${name}').default
      module.exports = createReactPlayer([Player])
    `
    await writeFile(join('.', `${key}.js`), file)
  }
}

generateSinglePlayers()

const { join } = require('path')
const { writeFile } = require('fs').promises
const { default: players } = require('../lib/players')

const generateSinglePlayers = async () => {
  for (const { key, name } of players) {
    const file = `
      const createReactPlayer = require('./lib/ReactPlayer').createReactPlayer
      const Player = require('./lib/players/${name}').default
      module.exports = createReactPlayer([Player])
    `
    await writeFile(join('.', `${key}.js`), file)
  }
}

generateSinglePlayers()

Fix single player imports on IE11
Fix single player imports on IE11

Fixes https://github.com/CookPete/react-player/issues/954
