-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbase.js
More file actions
37 lines (31 loc) · 1.01 KB
/
base.js
File metadata and controls
37 lines (31 loc) · 1.01 KB
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
const path = require('path');
const funnel = require('broccoli-funnel');
const merge = require('broccoli-merge-trees');
module.exports = class Base {
constructor(options) {
this.getCssExtentions = options.getCssExtentions;
this.baseName = options.baseName;
}
get extentions() {
return this.getCssExtentions();
}
colocatedStyles(tree, srcDir = this.baseName, destDir = this.baseName) {
const baseFiles = funnel(tree, {
srcDir,
destDir,
allowEmpty: true,
annotation: 'Funnel (ember-cli-styles-colocation grab files addon style files)',
});
const classicStyles = funnel(tree, {
srcDir: path.join(srcDir, 'styles', 'component-styles'),
destDir,
allowEmpty: true,
});
return funnel(merge([baseFiles, classicStyles], { overwrite: true }), {
include: [`**/*.{${this.extentions},}`],
exclude: [`**/styles/**/*`],
allowEmpty: true,
annotation: 'Funnel (ember-cli-styles-colocation grab files addon style files)',
});
}
};