Skip to content

Commit

Permalink
remove isomorphic-fetch and imports/exports loaders (fixes #590, #571,
Browse files Browse the repository at this point in the history
…#477, #420) (#593)

* remove isomorphic-fetch and imports/exports loaders, use whatwg-fetch, replace webpack specific syntax in fetch.js and move it to webpack config

* remove deprecated loaders

* Revert "remove deprecated loaders"

This reverts commit 90bc2d0.
  • Loading branch information
flipace authored and Josh Kuhn committed Jun 16, 2016
1 parent d1509b8 commit be83b22
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions client/package.json
Expand Up @@ -21,6 +21,8 @@
"exports-loader": "^0.6.3",
"imports-loader": "^0.6.5",
"isomorphic-fetch": "^2.2.1",
"whatwg-fetch": "^1.0.0",
"es6-promise": "^3.2.1",
"rxjs": "5.0.0-beta.7",
"snake-case": "^1.1.2"
},
Expand All @@ -41,6 +43,8 @@
"copy-webpack-plugin": "^1.1.1",
"cross-env": "^1.0.7",
"eslint": "2.2.x",
"exports-loader": "^0.6.3",
"imports-loader": "^0.6.5",
"istanbul": "^0.4.2",
"lodash": "^4.6.1",
"mocha": "2.3.4",
Expand Down
3 changes: 0 additions & 3 deletions client/src/util/fetch.js
Expand Up @@ -2,9 +2,6 @@ import { Observable } from 'rxjs/Observable'
import 'rxjs/add/observable/fromPromise'
import 'rxjs/add/operator/mergeMap'

global.self = global
require('imports?this=>global!exports?global.fetch!isomorphic-fetch')

export default function fetchJSON(url) {
return Observable.fromPromise(fetch(url))
.mergeMap(response => {
Expand Down
5 changes: 5 additions & 0 deletions client/webpack.horizon.config.js
Expand Up @@ -6,6 +6,7 @@ const DefinePlugin = require('webpack/lib/DefinePlugin')
const OccurrenceOrderPlugin = require(
'webpack/lib/optimize/OccurrenceOrderPlugin')
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin')
const ProvidePlugin = require('webpack/lib/ProvidePlugin');

module.exports = function(buildTarget) {
const FILENAME = buildTarget.FILENAME
Expand Down Expand Up @@ -84,6 +85,10 @@ module.exports = function(buildTarget) {
new DefinePlugin({
'process.env.NODE_ENV': (DEV_BUILD ? 'development' : 'production'),
}),
new ProvidePlugin({
'Promise': 'es6-promise',
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
}),
].concat(DEV_BUILD ? [] : [
new DedupePlugin(),
new OccurrenceOrderPlugin(),
Expand Down

0 comments on commit be83b22

Please sign in to comment.