-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move lazy loading players to react-player/lazy
Fixes cookpete/react-player#912 Fixes cookpete/react-player#907 Fixes cookpete/react-player#865 Sort of fixes cookpete/react-player#910 Sort of fixes cookpete/react-player#902 Affects cookpete/react-player#886 Affects cookpete/react-player#738
- Loading branch information
1 parent
1ed2a70
commit 31baff6
Showing
5 changed files
with
53 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,6 @@ yarn-error.log | |
package-lock.json | ||
.DS_Store | ||
/lib | ||
/lazy | ||
/demo | ||
/coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const getExcludes = lazy => { | ||
if (lazy) { | ||
// Disable transforming `import()` statements to enable lazy players | ||
return ['@babel/plugin-proposal-dynamic-import'] | ||
} | ||
return [] | ||
} | ||
|
||
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ exclude: getExcludes(process.env.LAZY) } | ||
], | ||
'@babel/preset-react' | ||
], | ||
plugins: [ | ||
'react-hot-loader/babel', | ||
'@babel/plugin-proposal-class-properties' | ||
], | ||
env: { | ||
test: { | ||
plugins: [ | ||
'istanbul' | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ReactPlayer from './ReactPlayer' | ||
|
||
export default ReactPlayer |