Skip to content

Commit

Permalink
[fastboot-fix]: Only define 'fetch' when FastBoot is available
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Rarela committed Sep 8, 2017
1 parent 0bc08d0 commit 4e3ac0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-fetch",
"version": "3.3.1",
"version": "3.3.2",
"description": "HTML5 Fetch polyfill (as an ember-addon)",
"typings": "./index.d.ts",
"keywords": [
Expand Down
4 changes: 4 additions & 0 deletions public/fastboot-fetch.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
(function() {
if (typeof FastBoot === 'undefined' || typeof FastBoot.require === 'undefined') {
return
}

define('fetch', ['exports'], function(self) {
var fetch = FastBoot.require('node-fetch');
self['default'] = fetch;
Expand Down

0 comments on commit 4e3ac0b

Please sign in to comment.