Skip to content

Commit 477643e

Browse files
Fix for fastboot 1.0, closes #89
1 parent c73fb10 commit 477643e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

index.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
/* eslint-env node */
22
'use strict';
33

4-
let path = require('path');
5-
let Funnel = require('broccoli-funnel');
6-
let MergeTrees = require('broccoli-merge-trees');
4+
const path = require('path');
5+
const Funnel = require('broccoli-funnel');
6+
const MergeTrees = require('broccoli-merge-trees');
7+
const map = require('broccoli-stew').map;
78

89
module.exports = {
910

1011
name: 'ember-gestures',
1112

12-
included: function (app) {
13+
included(app) {
1314
this._super.included.apply(this, arguments);
1415

1516
// see: https://github.com/ember-cli/ember-cli/issues/3718
1617
if (typeof app.import !== 'function' && app.app) {
1718
app = app.app;
1819
}
1920

20-
if (!process.env.EMBER_CLI_FASTBOOT) {
21-
app.import('vendor/hammer.js');
22-
}
21+
22+
app.import('vendor/hammer.js');
2323
},
2424

2525
treeForVendor(vendorTree) {
2626
let trees = [];
2727
let hammerTree = new Funnel(path.dirname(require.resolve('hammerjs')), {
2828
files: ['hammer.js']
2929
});
30+
hammerTree = map(hammerTree, (content) => `if (typeof FastBoot === 'undefined') { ${content} }`);
31+
3032

3133
if (vendorTree !== undefined) {
3234
trees.push(vendorTree);
@@ -37,7 +39,7 @@ module.exports = {
3739
return new MergeTrees(trees);
3840
},
3941

40-
isDevelopingAddon: function() {
42+
isDevelopingAddon() {
4143
return false;
4244
}
4345

0 commit comments

Comments
 (0)