Sha256: a825c0cd04020f624cd00471a35989379a69e140104781971f5bd69f11c555de

Contents?: true

Size: 594 Bytes

Versions: 4

Compression:

Stored size: 594 Bytes

Contents

import { Application } from '@hotwired/stimulus'
import { definitionsFromContext } from '@hotwired/stimulus-webpack-helpers'

import ApplicationController from './application_controller'

window.Stimulus = Application.start()

const context = require.context('.', true, /\.js$/)
const controllerDefinitions = definitionsFromContext(context)
Stimulus.load(controllerDefinitions)

const Controllers = controllerDefinitions.reduce((result, definition) => {
  return { ...result, [definition.identifier]: definition.controllerConstructor }
}, {})

export {
  ApplicationController,
  Controllers
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
trestle-0.10.1 frontend/js/controllers/index.js
trestle-0.10.0 frontend/js/controllers/index.js
trestle-0.10.0.pre2 frontend/js/controllers/index.js
trestle-0.10.0.pre frontend/js/controllers/index.js