Skip to content
This repository was archived by the owner on Dec 26, 2019. It is now read-only.

Commit 6369896

Browse files
committed
Prepare for FastBoot 1.0
1 parent aa79f23 commit 6369896

File tree

3 files changed

+4945
-5
lines changed

3 files changed

+4945
-5
lines changed

index.js

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,40 @@
11
/* jshint node: true */
22
'use strict';
33

4+
var path = require('path');
5+
var existsSync = require('exists-sync');
6+
var fastbootTransform = require('fastboot-transform');
7+
var Funnel = require('broccoli-funnel');
8+
49
module.exports = {
510
name: 'ember-cli-bootstrap-datepicker',
611

712
included: function(app) {
813
this._super.included(app);
914

10-
if (process.env.EMBER_CLI_FASTBOOT !== 'true') {
11-
app.import(app.bowerDirectory + '/bootstrap-datepicker/dist/js/bootstrap-datepicker.js');
12-
app.import(app.bowerDirectory + '/bootstrap-datepicker/dist/css/bootstrap-datepicker.css');
15+
app.import('vendor/bootstrap-datepicker/bootstrap-datepicker.js');
16+
app.import(app.bowerDirectory + '/bootstrap-datepicker/dist/css/bootstrap-datepicker.css');
17+
},
18+
19+
treeForVendor(tree) {
20+
var trees = [];
21+
22+
if (tree) {
23+
trees.push(tree);
24+
}
25+
26+
var bootstrapDatepickerPath = path.join(this.project.root, this.app.bowerDirectory, 'bootstrap-datepicker', 'dist', 'js');
27+
28+
if (existsSync(bootstrapDatepickerPath)) {
29+
var bootstrapTree = fastbootTransform(new Funnel(bootstrapDatepickerPath, {
30+
files: ['bootstrap-datepicker.js'],
31+
destDir: 'bootstrap-datepicker'
32+
}));
33+
34+
trees.push(bootstrapTree);
1335
}
36+
37+
return trees;
1438
}
1539
};
1640

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
"ember-cli-sri": "^1.2.0",
3333
"ember-cli-uglify": "^1.2.0",
3434
"ember-data": "1.13.15",
35+
"ember-disable-prototype-extensions": "^1.0.0",
3536
"ember-disable-proxy-controllers": "^1.0.1",
3637
"ember-export-application-global": "^1.0.4",
37-
"ember-disable-prototype-extensions": "^1.0.0",
3838
"ember-try": "~0.0.8"
3939
},
4040
"keywords": [
@@ -46,7 +46,10 @@
4646
"datepicker"
4747
],
4848
"dependencies": {
49-
"ember-cli-babel": "^5.1.5"
49+
"broccoli-funnel": "^1.2.0",
50+
"ember-cli-babel": "^5.1.5",
51+
"exists-sync": "^0.0.4",
52+
"fastboot-transform": "^0.1.1"
5053
},
5154
"main": "index.js",
5255
"ember-addon": {

0 commit comments

Comments
 (0)