File tree Expand file tree Collapse file tree 3 files changed +44
-12
lines changed Expand file tree Collapse file tree 3 files changed +44
-12
lines changed Original file line number Diff line number Diff line change @@ -26,15 +26,30 @@ module.exports = {
2626 } ,
2727
2828 included : function included ( app ) {
29- var bowerDir = app . bowerDirectory ;
30-
31- app . import ( bowerDir + '/pouchdb/dist/pouchdb.js' ) ;
32- app . import ( bowerDir + '/relational-pouch/dist/pouchdb.relational-pouch.js' ) ;
33- app . import ( 'vendor/ember-pouch/shim.js' , {
34- type : 'vendor' ,
35- exports : {
36- 'pouchdb' : [ 'default' ]
37- }
38- } ) ;
29+ if ( isFastBoot ( ) ) {
30+ app . import ( 'vendor/ember-pouch/ember-pouch-fastboot.js' ) ;
31+ } else {
32+ var bowerDir = app . bowerDirectory ;
33+
34+ app . import ( bowerDir + '/pouchdb/dist/pouchdb.js' ) ;
35+ app . import ( bowerDir + '/relational-pouch/dist/pouchdb.relational-pouch.js' ) ;
36+ app . import ( 'vendor/ember-pouch/shim.js' , {
37+ type : 'vendor' ,
38+ exports : {
39+ 'pouchdb' : [ 'default' ]
40+ }
41+ } ) ;
42+ }
3943 }
4044} ;
45+
46+ // Steal *all the things* from github.com/tomdale/ember-network !
47+
48+ var funnel = require ( 'broccoli-funnel' ) ;
49+
50+ // Checks to see whether this build is targeting FastBoot. Note that we cannot
51+ // check this at boot time--the environment variable is only set once the build
52+ // has started, which happens after this file is evaluated.
53+ function isFastBoot ( ) {
54+ return process . env . EMBER_CLI_FASTBOOT === 'true' ;
55+ }
Original file line number Diff line number Diff line change 5252 "ember-try" : " ~0.0.8"
5353 },
5454 "dependencies" : {
55+ "broccoli-funnel" : " ^1.0.1" ,
5556 "ember-cli-babel" : " ^5.1.5" ,
56- "ember-cli-version-checker" : " 1.1.5"
57+ "ember-cli-version-checker" : " 1.1.5" ,
58+ "pouchdb" : " ^5.2.1" ,
59+ "relational-pouch" : " ^1.4.0"
5760 },
5861 "ember-addon" : {
59- "configPath" : " tests/dummy/config"
62+ "configPath" : " tests/dummy/config" ,
63+ "fastBootDependencies" : [" pouchdb" , " relational-pouch" ]
6064 }
6165}
Original file line number Diff line number Diff line change 1+ ; ( function ( ) {
2+ 'use strict' ;
3+
4+ define ( 'pouchdb' , [ 'exports' ] , function ( __exports__ ) {
5+ var PouchDB = FastBoot . require ( 'pouchdb' ) ;
6+
7+ // Register plugins!
8+ PouchDB . plugin ( FastBoot . require ( 'relational-pouch' ) ) ;
9+
10+ __exports__ [ 'default' ] = PouchDB ;
11+ } ) ;
12+
13+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments