2021-01-12 10:13:21 -05:00
|
|
|
"use strict";
|
|
|
|
|
2023-02-09 11:24:24 -05:00
|
|
|
const widgetHbsCompilerPath = require.resolve("./lib/widget-hbs-compiler");
|
2021-01-12 10:13:21 -05: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 11:24:24 -05:00
|
|
|
babelPlugins.push({
|
|
|
|
_parallelBabel: {
|
|
|
|
requireFile: widgetHbsCompilerPath,
|
|
|
|
useMethod: "WidgetHbsCompiler",
|
|
|
|
},
|
|
|
|
});
|
2021-01-12 10:13:21 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
_getAddonOptions() {
|
|
|
|
return (
|
|
|
|
(this.parent && this.parent.options) ||
|
|
|
|
(this.app && this.app.options) ||
|
|
|
|
{}
|
|
|
|
);
|
|
|
|
},
|
|
|
|
};
|