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