diff --git a/package.json b/package.json index a409b93..0c16c86 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "react-router": "^2.0.0-rc5", "react-router-redux": "^2.1.0", "redux": "^3.0.4", - "redux-thunk": "^1.0.0" + "redux-thunk": "^1.0.0", + "whatwg-fetch": "^0.11.0" }, "devDependencies": { "babel-core": "^6.0.0", @@ -47,9 +48,10 @@ "cssnano": "^3.4.0", "eslint": "^1.10.3", "eslint-plugin-react": "^3.13.1", + "exports-loader": "^0.6.3", "extract-text-webpack-plugin": "^0.9.1", "html-webpack-plugin": "^1.7.0", - "imports-loader": "^0.6.4", + "imports-loader": "^0.6.5", "karma": "*", "karma-chai": "*", "karma-es5-shim": "*", diff --git a/webpack.config.js b/webpack.config.js index f1b4fe9..4afb668 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -45,6 +45,7 @@ var webpackConfig = { app: path.join(__dirname, 'src'), vendor: [ 'babel-polyfill', + 'whatwg-fetch', 'classnames', 'history', 'intl-format-cache', @@ -111,6 +112,10 @@ var webpackConfig = { minify: { collapseWhitespace: isProduction } + }), + new webpack.ProvidePlugin({ + // window.fetch polyfill + fetch: 'imports?this=>self!exports?self.fetch!whatwg-fetch' }) ].concat(isTest ? [] : [ new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js')