mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 16:41:18 +08:00
c3fd91670e
Re-lands #16119 and #17298 * Update eslint-config-discourse * Update linting workflow * Prettier-ignore stuff * Update template-lint config * Auto-fix template issues * Fix various template issues Mostly incorrect attributes and unused templates * Prettier js files * Fix template auto-fix regressions * Small css tweak Co-authored-by: Peter Wagenet <peter.wagenet@gmail.com>
31 lines
802 B
JavaScript
31 lines
802 B
JavaScript
"use strict";
|
|
|
|
const WidgetHbsCompiler =
|
|
require("../../../../lib/javascripts/widget-hbs-compiler").WidgetHbsCompiler;
|
|
|
|
const glimmer = require("@glimmer/syntax");
|
|
|
|
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;
|
|
|
|
WidgetHbsCompiler.cacheKey = () => "discourse-widget-hbs";
|
|
WidgetHbsCompiler.glimmer = glimmer;
|
|
babelPlugins.push(WidgetHbsCompiler);
|
|
},
|
|
|
|
_getAddonOptions() {
|
|
return (
|
|
(this.parent && this.parent.options) ||
|
|
(this.app && this.app.options) ||
|
|
{}
|
|
);
|
|
},
|
|
};
|