2018-06-15 23:03:24 +08:00
|
|
|
import { registerHelpers } from "discourse-common/lib/helpers";
|
2016-10-25 01:49:17 +08:00
|
|
|
|
2016-08-26 01:14:56 +08:00
|
|
|
export default {
|
2018-06-15 23:03:24 +08:00
|
|
|
name: "load-helpers",
|
2016-08-26 01:14:56 +08:00
|
|
|
|
2016-11-26 03:29:24 +08:00
|
|
|
initialize(application) {
|
2016-08-26 01:14:56 +08:00
|
|
|
Object.keys(requirejs.entries).forEach(entry => {
|
2018-06-15 23:03:24 +08:00
|
|
|
if (/\/helpers\//.test(entry)) {
|
2017-07-06 02:14:30 +08:00
|
|
|
requirejs(entry, null, null, true);
|
2016-08-26 01:14:56 +08:00
|
|
|
}
|
|
|
|
});
|
2016-11-26 03:29:24 +08:00
|
|
|
registerHelpers(application);
|
2016-08-26 01:14:56 +08:00
|
|
|
}
|
|
|
|
};
|