2023-03-01 09:39:41 -06:00
|
|
|
/**
|
2026-01-28 17:09:06 -08:00
|
|
|
* Copyright IBM Corp. 2021, 2026
|
2024-05-31 11:29:24 -07:00
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
2023-03-01 09:39:41 -06:00
|
|
|
*/
|
|
|
|
|
|
2021-03-05 14:22:06 -05:00
|
|
|
'use strict';
|
2021-08-18 11:53:44 -04:00
|
|
|
|
|
|
|
|
var path = require('path');
|
|
|
|
|
|
2020-11-18 11:58:16 -05:00
|
|
|
module.exports = {
|
2021-03-05 14:22:06 -05:00
|
|
|
name: require('./package').name,
|
2021-08-18 11:53:44 -04:00
|
|
|
|
2025-03-06 12:20:48 -08:00
|
|
|
options: {
|
|
|
|
|
babel: {
|
|
|
|
|
plugins: [
|
|
|
|
|
require.resolve('ember-concurrency/async-arrow-task-transform'),
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
2021-08-18 11:53:44 -04:00
|
|
|
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 });
|
|
|
|
|
},
|
2020-11-18 11:58:16 -05:00
|
|
|
};
|