Skip to content

Commit

Permalink
try using ember-cli-fastboot-addon
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanley Stuart committed Mar 9, 2016
1 parent c27b3f0 commit c9de8e0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
6 changes: 6 additions & 0 deletions addon/fastboot/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {require} from 'ember-cli-fastboot-addon';

const PouchDB = require('pouchdb');
PouchDB.plugin(require('relational-pouch'));

export default PouchDB;
15 changes: 11 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ module.exports = {
}
},

treeForAddon: function(tree) {
var fastbootTree = require('ember-cli-fastboot-addon').fastbootTree;
return this._super.treeForAddon.call(this, fastbootTree(tree));
},

treeForApp: function(tree) {
var fastbootTree = require('ember-cli-fastboot-addon').fastbootTree;
return fastbootTree(tree);
},

included: function included(app) {
if (isFastBoot()) {
app.import('vendor/ember-pouch/ember-pouch-fastboot.js');
} else {
if (!isFastBoot()) {
var bowerDir = app.bowerDirectory;

app.import(bowerDir + '/pouchdb/dist/pouchdb.js');
Expand All @@ -45,7 +53,6 @@ module.exports = {

// Steal *all the things* from github.com/tomdale/ember-network !

var funnel = require('broccoli-funnel');

// Checks to see whether this build is targeting FastBoot. Note that we cannot
// check this at boot time--the environment variable is only set once the build
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,23 @@
"ember-cli-sri": "^1.2.0",
"ember-cli-uglify": "^1.2.0",
"ember-data": "~1.13.0 || 2.x",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-try": "~0.0.8"
},
"dependencies": {
"broccoli-funnel": "^1.0.1",
"ember-cli-babel": "^5.1.5",
"ember-cli-version-checker": "1.1.5",
"pouchdb": "^5.2.1",
"relational-pouch": "^1.4.0"
"relational-pouch": "^1.4.0",
"ember-cli-fastboot-addon": "0.1.0"
},
"ember-addon": {
"configPath": "tests/dummy/config",
"fastBootDependencies": ["pouchdb", "relational-pouch"]
"fastBootDependencies": [
"pouchdb",
"relational-pouch"
]
}
}

0 comments on commit c9de8e0

Please sign in to comment.