Skip to content

Commit

Permalink
Merge pull request #96 from zonkyio/fastbootCompabilityIssuesSolved
Browse files Browse the repository at this point in the history
Node compatibility problem solved
  • Loading branch information
jherdman authored Oct 1, 2018
2 parents dbc7e44 + b1f2ad5 commit a4e500d
Show file tree
Hide file tree
Showing 3 changed files with 3,478 additions and 3,233 deletions.
34 changes: 32 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
'use strict';

const Funnel = require('broccoli-funnel');
const mergeTrees = require('broccoli-merge-trees');
const fastbootTransform = require('fastboot-transform');
const path = require('path');

module.exports = {
name: require('./package').name,

Expand All @@ -18,9 +23,34 @@ module.exports = {
}
},

treeForVendor(defaultTree) {
let trees = [];

if (defaultTree) {
trees.push(defaultTree);
}
const trackjsPath = path.join(this.project.root, 'node_modules', 'trackjs')

const browserVendorLib = fastbootTransform(
new Funnel(trackjsPath, {
files: ["tracker.js"],
destDir: "trackjs"
})
);

trees.push(browserVendorLib);

return mergeTrees(trees);
},

included(app) {
this._super.included(app);
this._super.included.apply(this, arguments);

// allow addon to be nested - see: https://github.com/ember-cli/ember-cli/issues/3718
while (app.app) {
app = app.app;
}

app.import(require.resolve('trackjs'));
app.import(`${this.treePaths.vendor}/trackjs/tracker.js`);
}
};
Loading

0 comments on commit a4e500d

Please sign in to comment.