diff --git a/app/assets/javascripts/discourse-common/addon/resolver.js b/app/assets/javascripts/discourse-common/addon/resolver.js index 462bec5212d..7fc67738b05 100644 --- a/app/assets/javascripts/discourse-common/addon/resolver.js +++ b/app/assets/javascripts/discourse-common/addon/resolver.js @@ -119,8 +119,19 @@ export function clearResolverOptions() { function lookupModuleBySuffix(suffix) { if (!moduleSuffixTrie) { moduleSuffixTrie = new SuffixTrie("/"); + const searchPaths = [ + "discourse/", // Includes themes/plugins + "discourse-common/", + "select-kit/", + "admin/", + "wizard/", + "truth-helpers/", + ]; Object.keys(requirejs.entries).forEach((name) => { - if (!name.includes("/templates/")) { + if ( + searchPaths.some((s) => name.startsWith(s)) && + !name.includes("/templates/") + ) { moduleSuffixTrie.add(name); } }); diff --git a/app/assets/javascripts/discourse/lib/dialog-holder/app/services/dialog.js b/app/assets/javascripts/discourse/lib/dialog-holder/app/services/dialog.js new file mode 100644 index 00000000000..cf0c5483acd --- /dev/null +++ b/app/assets/javascripts/discourse/lib/dialog-holder/app/services/dialog.js @@ -0,0 +1 @@ +export { default } from "dialog-holder/services/dialog";