Files
threshold-ui/addons/core/index.js
T
hashicorp-copywrite[bot]andCameron Perera 3d610427d0 [COMPLIANCE] Add Copyright and License Headers (#1617)
* [COMPLIANCE] Add Copyright and License Headers

* chore: 🤖 update Copyright headers to satisfy our lint rules

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Cameron Perera <cameron.perera@hashicorp.com>
2023-03-01 09:39:41 -06:00

47 lines
1.2 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
'use strict';
var path = require('path');
module.exports = {
name: require('./package').name,
included(app) {
this._super.included.apply(this, arguments);
this.includePublic(app);
this.setupSVGO(app);
},
/**
* Finds the public folder and includes it into the ember-inline-svg addon.
*/
includePublic(app) {
const publicPath = path.resolve('public');
const dummyPublicPath = path.resolve('tests/dummy/public');
app.options.svg = app.options.svg || {};
app.options.svg.paths = app.options.svg.paths || [];
app.options.svg.paths.push(publicPath);
if (this.isDevelopingAddon()) app.options.svg.paths.push(dummyPublicPath);
this.addons.forEach((addon) => {
if (addon.name === 'ember-inline-svg') addon.included(app);
});
},
/**
* Adjust SVG optimizer defaults (used by ember-inline-svg).
*/
setupSVGO(app) {
app.options.svg = app.options.svg || {};
app.options.svg.optimize = app.options.svg.optimize || {};
app.options.svg.optimize.plugins = app.options.svg.optimize.plugins || [];
app.options.svg.optimize.plugins.push({ removeViewBox: false });
},
};