Skip to content

Commit

Permalink
Add promise and fetch polyfills to build
Browse files Browse the repository at this point in the history
Previously we were polyfilling using webpack, which of course only affected the demo and not the actual build
Fixes cookpete/react-player#39
  • Loading branch information
philip-luther committed Nov 22, 2024
1 parent 93c36bd commit 7c0eb41
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@
"style-loader": "^0.13.0",
"webpack": "^1.12.9",
"webpack-dev-middleware": "^1.4.0",
"webpack-hot-middleware": "^2.6.0",
"whatwg-fetch": "^0.11.0"
"webpack-hot-middleware": "^2.6.0"
},
"dependencies": {
"es6-promise": "^3.1.2",
"load-script": "^1.0.0",
"query-string": "^3.0.0"
"query-string": "^3.0.0",
"whatwg-fetch": "^0.11.0"
},
"standard": {
"parser": "babel-eslint",
Expand Down
2 changes: 2 additions & 0 deletions src/ReactPlayer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'es6-promise'
import 'whatwg-fetch'
import React, { Component } from 'react'

import { propTypes, defaultProps } from './props'
Expand Down
5 changes: 1 addition & 4 deletions webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ module.exports = {
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
})
new webpack.NoErrorsPlugin()
],
module: {
loaders: [{
Expand Down

0 comments on commit 7c0eb41

Please sign in to comment.