Skip to content

Commit

Permalink
more polyfills for the browser
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresrhys committed Feb 3, 2018
1 parent 2e8222c commit 0b36213
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"scripts": {
"test": "make lint test",
"bundle": "webpack --output-library fetchMock --entry ./es5/client.js --output-filename ./es5/client-bundle.js",
"prepublish": "babel src --out-dir es5 --presets env --plugins transform-runtime && npm run bundle"
"prepublish": "babel src --out-dir es5 && npm run bundle"
},
"babel": {
"presets": [["env", {"useBuiltIns": "entry"}]],
"plugins": [["transform-runtime", {"polyfill": true}]]
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -36,6 +40,7 @@
"babel-cli": "^6.1.2",
"babel-loader": "^7.1.2",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"bluebird": "^3.4.6",
"chai": "^4.1.2",
Expand All @@ -46,8 +51,8 @@
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-mocha": "^1.3.0",
"karma-webpack": "^2.0.9",
"karma-mocha-reporter": "^2.2.5",
"karma-webpack": "^2.0.9",
"mocha": "^4.0.1",
"node-fetch": "^2.0.0-alpha.9",
"sinon": "^4.1.3",
Expand Down
3 changes: 2 additions & 1 deletion src/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require('babel-polyfill');
const FetchMock = require('./lib/index');
const statusTextMap = require('./lib/status-text');
const theGlobal = typeof window !== 'undefined' ? window : self;
Expand All @@ -12,4 +13,4 @@ FetchMock.config = Object.assign(FetchMock.config, {
Headers: theGlobal.Headers
});

module.exports = FetchMock.createInstance();
module.exports = FetchMock.createInstance();

0 comments on commit 0b36213

Please sign in to comment.