-
Notifications
You must be signed in to change notification settings - Fork 23
/
index.js
43 lines (34 loc) · 1.19 KB
/
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
38
39
40
41
42
43
'use strict';
const path = require('path');
module.exports = {
name: require('./package').name,
included() {
this._super.included.apply(this, arguments);
// Get the host app, even in nested addons/engines
let target = this._findHost();
let options = target.options['ember-date-components'] || {};
let includeCSS =
typeof options.includeCSS !== 'undefined' ? options.includeCSS : true;
if (includeCSS) {
target.import('vendor/ember-date-components.css');
}
// If the host app has ember-cli-sass installed, add the app folder to the sass include paths
let hasEmberCliSass = !!target.project.addons.find(
(a) => a.name === 'ember-cli-sass'
);
if (hasEmberCliSass) {
target.options.sassOptions = target.options.sassOptions || {};
target.options.sassOptions.includePaths =
target.options.sassOptions.includePaths || [];
target.options.sassOptions.includePaths.push(
path.join(__dirname, 'app', 'styles')
);
}
},
contentFor(type, config) {
let emberBasicDropdown = this.addons.find(
(a) => a.name === 'ember-basic-dropdown'
);
return emberBasicDropdown.contentFor(type, config);
},
};