import { Application } from "@hotwired/stimulus"
import DropdownController  from "./dropdown_controller"
import HelloController     from "./hello_controller"
import { definitionsFromContext } from "@hotwired/stimulus-loading"

const application = Application.start()
const context = require.context("./", true, /\.js$/)
application.load(definitionsFromContext(context))

// Register custom controllers
application.register("dropdown", DropdownController)
application.register("hello", HelloController)

// Configure Stimulus development experience
application.debug = false
window.Stimulus   = application

export { application }
