2021-01-12 09:13:21 -06:00
|
|
|
"use strict";
|
|
|
|
|
2023-02-09 10:24:24 -06:00
|
|
|
const widgetHbsCompilerPath = require.resolve("./lib/widget-hbs-compiler");
|
2021-01-12 09:13:21 -06:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: require("./package").name,
|
|
|
|
|
|
|
|
included() {
|
|
|
|
this._super.included.apply(this, arguments);
|
|
|
|
let addonOptions = this._getAddonOptions();
|
|
|
|
addonOptions.babel = addonOptions.babel || {};
|
|
|
|
addonOptions.babel.plugins = addonOptions.babel.plugins || [];
|
|
|
|
let babelPlugins = addonOptions.babel.plugins;
|
|
|
|
|
2023-02-09 10:24:24 -06:00
|
|
|
babelPlugins.push({
|
|
|
|
_parallelBabel: {
|
|
|
|
requireFile: widgetHbsCompilerPath,
|
|
|
|
useMethod: "WidgetHbsCompiler",
|
|
|
|
},
|
|
|
|
});
|
2021-01-12 09:13:21 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
_getAddonOptions() {
|
|
|
|
return (
|
|
|
|
(this.parent && this.parent.options) ||
|
|
|
|
(this.app && this.app.options) ||
|
|
|
|
{}
|
|
|
|
);
|
|
|
|
},
|
|
|
|
};
|