2023-03-14 13:18:55 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
2023-03-14 13:18:55 +00:00
|
|
|
*/
|
|
|
|
|
2020-12-14 15:28:35 +00:00
|
|
|
/*eslint node/no-extraneous-require: "off"*/
|
2020-09-15 17:45:08 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const Funnel = require('broccoli-funnel');
|
|
|
|
const mergeTrees = require('broccoli-merge-trees');
|
2022-02-03 08:40:03 +00:00
|
|
|
const writeFile = require('broccoli-file-creator');
|
|
|
|
const read = require('fs').readFileSync;
|
2020-09-15 17:45:08 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: require('./package').name,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Make any CSS available for import within app/components/component-name:
|
|
|
|
* @import 'app-name/components/component-name/index.scss'
|
|
|
|
*/
|
2022-09-15 08:43:17 +00:00
|
|
|
treeForStyles: function (tree) {
|
2022-02-03 08:40:03 +00:00
|
|
|
let debug = read(`${this.project.root}/app/styles/debug.scss`);
|
|
|
|
if (['production', 'test'].includes(process.env.EMBER_ENV)) {
|
|
|
|
debug = '';
|
|
|
|
}
|
2020-09-15 17:45:08 +00:00
|
|
|
return this._super.treeForStyles.apply(this, [
|
2022-02-03 08:40:03 +00:00
|
|
|
mergeTrees([
|
|
|
|
writeFile(`_debug.scss`, debug),
|
|
|
|
new Funnel(`${this.project.root}/app/components`, {
|
|
|
|
destDir: `app/components`,
|
|
|
|
include: ['**/*.scss'],
|
|
|
|
}),
|
|
|
|
]),
|
2020-09-15 17:45:08 +00:00
|
|
|
]);
|
|
|
|
},
|
|
|
|
};
|