|
| 1 | +import { application } from './controllers/application' |
1 | 2 |
|
2 | | -import { Application } from "@hotwired/stimulus" |
3 | | -import FlashController from "./flash_controller" |
4 | | -// import ModalController from "./modal_controller" |
5 | | -import DynamicSelectController from "./dynamic_select_controller" |
6 | | -import NewPersonCommunityMembershipController from "./new_person_community_membership_controller" |
7 | | -import PersonCommunityMembershipController from "./person_community_membership_controller" |
8 | | - |
9 | | -const application = Application.start() |
10 | | - |
11 | | -// Configure Stimulus development experience |
12 | | -application.debug = true |
13 | | -window.Stimulus = application |
14 | | - |
15 | | -console.log('start application') |
16 | | - |
17 | | -Stimulus.register('flash', FlashController) |
18 | | -// Stimulus.register('modal', ModalController) |
19 | | -Stimulus.register('bt-dynamic-select', DynamicSelectController) |
20 | | -Stimulus.register('bt-new-person-community-membership', NewPersonCommunityMembershipController) |
21 | | -Stimulus.register('bt-person-community-membership', PersonCommunityMembershipController) |
22 | | - |
23 | | -// Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!) |
24 | | -import { lazyLoadControllersFrom } from 'stimulus-loading' // Adjust the path if necessary |
25 | | -lazyLoadControllersFrom("controllers", application) |
26 | | - |
27 | | -console.log('initializing engine controllers') |
28 | | - |
29 | | -export { application } |
| 3 | +// Eager load all controllers defined in the import map under controllers/**/*_controller |
| 4 | +import { lazyLoadControllersFrom } from 'stimulus-loading' |
| 5 | +lazyLoadControllersFrom('./better_together/controllers', application) |
0 commit comments