Skip to content

Commit

Permalink
Add webpackChunkName to dynamic imports
Browse files Browse the repository at this point in the history
Fixes #899
  • Loading branch information
cookpete committed May 31, 2020
1 parent c4c597f commit 9d679f5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/players/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,59 +46,59 @@ export default [
{
key: 'youtube',
canPlay: url => MATCH_URL_YOUTUBE.test(url),
lazyPlayer: lazy(() => import('./YouTube'))
lazyPlayer: lazy(() => import(/* webpackChunkName: 'reactPlayerYouTube' */'./YouTube'))
},
{
key: 'soundcloud',
canPlay: url => MATCH_URL_SOUNDCLOUD.test(url) && !AUDIO_EXTENSIONS.test(url),
lazyPlayer: lazy(() => import('./SoundCloud'))
lazyPlayer: lazy(() => import(/* webpackChunkName: 'reactPlayerSoundCloud' */'./SoundCloud'))
},
{
key: 'vimeo',
canPlay: url => MATCH_URL_VIMEO.test(url) && !VIDEO_EXTENSIONS.test(url) && !HLS_EXTENSIONS.test(url),
lazyPlayer: lazy(() => import('./Vimeo'))
lazyPlayer: lazy(() => import(/* webpackChunkName: 'reactPlayerVimeo' */'./Vimeo'))
},
{
key: 'facebook',
canPlay: url => MATCH_URL_FACEBOOK.test(url),
lazyPlayer: lazy(() => import('./Facebook'))
lazyPlayer: lazy(() => import(/* webpackChunkName: 'reactPlayerFacebook' */'./Facebook'))
},
{
key: 'streamable',
canPlay: url => MATCH_URL_STREAMABLE.test(url),
lazyPlayer: lazy(() => import('./Streamable'))
lazyPlayer: lazy(() => import(/* webpackChunkName: 'reactPlayerStreamable' */'./Streamable'))
},
{
key: 'wistia',
canPlay: url => MATCH_URL_WISTIA.test(url),
lazyPlayer: lazy(() => import('./Wistia'))
lazyPlayer: lazy(() => import(/* webpackChunkName: 'reactPlayerWistia' */'./Wistia'))
},
{
key: 'twitch',
canPlay: url => MATCH_URL_TWITCH_VIDEO.test(url) || MATCH_URL_TWITCH_CHANNEL.test(url),
lazyPlayer: lazy(() => import('./Twitch'))
lazyPlayer: lazy(() => import(/* webpackChunkName: 'reactPlayerTwitch' */'./Twitch'))
},
{
key: 'dailymotion',
canPlay: url => MATCH_URL_DAILYMOTION.test(url),
lazyPlayer: lazy(() => import('./DailyMotion'))
lazyPlayer: lazy(() => import(/* webpackChunkName: 'reactPlayerDailyMotion' */'./DailyMotion'))
},
{
key: 'mixcloud',
canPlay: url => MATCH_URL_MIXCLOUD.test(url),
lazyPlayer: lazy(() => import('./Mixcloud'))
lazyPlayer: lazy(() => import(/* webpackChunkName: 'reactPlayerMixcloud' */'./Mixcloud'))
},
{
key: 'vidyard',
canPlay: url => MATCH_URL_VIDYARD.test(url),
lazyPlayer: lazy(() => import('./Vidyard'))
lazyPlayer: lazy(() => import(/* webpackChunkName: 'reactPlayerVidyard' */'./Vidyard'))
},
{
key: 'file',
canPlay: canPlayFile,
canEnablePIP: url => {
return canPlayFile(url) && (document.pictureInPictureEnabled || supportsWebKitPresentationMode()) && !AUDIO_EXTENSIONS.test(url)
},
lazyPlayer: lazy(() => import('./FilePlayer'))
lazyPlayer: lazy(() => import(/* webpackChunkName: 'reactPlayerFilePlayer' */'./FilePlayer'))
}
]

0 comments on commit 9d679f5

Please sign in to comment.