Skip to content

A platform for community discussion. Free, open, simple.

DEV: Ensure plugin raw connectors are transpiled to `/raw-templates` (#23170)

David Taylor201c39e68e22
diff --git a/app/assets/javascripts/discourse-plugins/index.js b/app/assets/javascripts/discourse-plugins/index.js
index 237fc2fdaf6..c207c4234eb 100644
--- a/app/assets/javascripts/discourse-plugins/index.js
+++ b/app/assets/javascripts/discourse-plugins/index.js
@@ -15,13 +15,18 @@ function fixLegacyExtensions(tree) {
getDestinationPath: function (relativePath) {
if (relativePath.endsWith(".es6")) {
return relativePath.slice(0, -4);
- } else if (relativePath.includes("/templates/")) {
- if (relativePath.endsWith(".raw.hbs")) {
- relativePath = relativePath.replace(".raw.hbs", ".hbr");
- }
+ } else if (relativePath.endsWith(".raw.hbs")) {
+ relativePath = relativePath.replace(".raw.hbs", ".hbr");
+ }
- if (relativePath.endsWith(".hbr")) {
- return relativePath.replace("/templates/", "/raw-templates/");
+ if (relativePath.endsWith(".hbr")) {
+ if (relativePath.includes("/templates/")) {
+ relativePath = relativePath.replace("/templates/", "/raw-templates/");
+ } else if (relativePath.includes("/connectors/")) {
+ relativePath = relativePath.replace(
+ "/connectors/",
+ "/raw-templates/connectors/"
+ );
}
}