diff --git a/app/assets/javascripts/discourse/initializers/auto-load-modules.js.es6 b/app/assets/javascripts/discourse/initializers/auto-load-modules.js.es6 new file mode 100644 index 00000000000..d870f52531c --- /dev/null +++ b/app/assets/javascripts/discourse/initializers/auto-load-modules.js.es6 @@ -0,0 +1,15 @@ +export function autoLoadModules() { + Ember.keys(requirejs.entries).forEach(entry => { + if ((/\/helpers\//).test(entry)) { + require(entry, null, null, true); + } + if ((/\/widgets\//).test(entry)) { + require(entry, null, null, true); + } + }); +} + +export default { + name: 'auto-load-modules', + initialize: autoLoadModules +}; diff --git a/app/assets/javascripts/discourse/initializers/load-all-helpers.js.es6 b/app/assets/javascripts/discourse/initializers/load-all-helpers.js.es6 deleted file mode 100644 index 93477787751..00000000000 --- a/app/assets/javascripts/discourse/initializers/load-all-helpers.js.es6 +++ /dev/null @@ -1,12 +0,0 @@ -export function loadAllHelpers() { - Ember.keys(requirejs.entries).forEach(entry => { - if ((/\/helpers\//).test(entry)) { - require(entry, null, null, true); - } - }); -} - -export default { - name: 'load-all-helpers', - initialize: loadAllHelpers -}; diff --git a/test/javascripts/helpers/component-test.js.es6 b/test/javascripts/helpers/component-test.js.es6 index 0fd3c8d6b2c..652424a95f3 100644 --- a/test/javascripts/helpers/component-test.js.es6 +++ b/test/javascripts/helpers/component-test.js.es6 @@ -1,6 +1,6 @@ import AppEvents from 'discourse/lib/app-events'; import createStore from 'helpers/create-store'; -import { loadAllHelpers } from 'discourse/initializers/load-all-helpers'; +import { autoLoadModules } from 'discourse/initializers/auto-load-modules'; export default function(name, opts) { opts = opts || {}; @@ -18,7 +18,7 @@ export default function(name, opts) { this.siteSettings = Discourse.SiteSettings; - loadAllHelpers(); + autoLoadModules(); if (opts.setup) { const store = createStore();