-
Notifications
You must be signed in to change notification settings - Fork 263
/
index.js
37 lines (32 loc) · 999 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* eslint-env node */
'use strict';
const MergeTrees = require('broccoli-merge-trees');
const Funnel = require('broccoli-funnel');
const path = require('path');
const writeFile = require('broccoli-file-creator');
const emberfire_version = require('./package.json').version;
const firebase_version = require('firebase').SDK_VERSION;
module.exports = {
name: 'emberfire',
options: {
autoImport:{
exclude: [],
webpack: {}
},
babel: {
plugins: [ require.resolve('ember-auto-import/babel-plugin') ]
}
},
included(app) {
this._super.included.apply(this, arguments);
this.import('vendor/emberfire/register-versions.js');
},
treeForVendor() {
const content = `Ember.libraries.register('EmberFire', '${emberfire_version}');\nEmber.libraries.register('Firebase', '${firebase_version}');`;
const registerVersionTree = writeFile(
'emberfire/register-versions.js',
content
);
return MergeTrees([registerVersionTree]);
}
};