Skip to content

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

DEV: Correct plugin-compilation connector template module path (#19165)

David Taylore330a596f548
diff --git a/app/assets/javascripts/discourse-plugins/index.js b/app/assets/javascripts/discourse-plugins/index.js
index 0b68baac3d1..730f926472b 100644
--- a/app/assets/javascripts/discourse-plugins/index.js
+++ b/app/assets/javascripts/discourse-plugins/index.js
@@ -36,7 +36,7 @@ function unColocateConnectors(tree) {
if (
match &&
match.groups.extension === "hbs" &&
- !match.groups.prefix.endsWith("/templates")
+ match.groups.prefix.split("/").pop() !== "templates"
) {
const { prefix, outlet, name } = match.groups;
return `${prefix}/templates/connectors/${outlet}/${name}.hbs`;
@@ -44,7 +44,7 @@ function unColocateConnectors(tree) {
if (
match &&
match.groups.extension === "js" &&
- match.groups.prefix.endsWith("/templates")
+ match.groups.prefix.split("/").pop() === "templates"
) {
// Some plugins are colocating connector JS under `/templates`
const { prefix, outlet, name } = match.groups;