diff --git a/app/javascript/packs/controllers/geo_controller.js b/app/javascript/controllers/geo_controller.js similarity index 100% rename from app/javascript/packs/controllers/geo_controller.js rename to app/javascript/controllers/geo_controller.js diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js new file mode 100644 index 00000000..6f53d84b --- /dev/null +++ b/app/javascript/controllers/index.js @@ -0,0 +1,9 @@ +// Load all the controllers within this directory and all subdirectories. +// Controller files must be named *_controller.js. + +import { Application } from "stimulus" +import { definitionsFromContext } from "stimulus/webpack-helpers" + +const application = Application.start() +const context = require.context("controllers", true, /_controller\.js$/) +application.load(definitionsFromContext(context)) diff --git a/app/javascript/packs/controllers/reorder_controller.js b/app/javascript/controllers/reorder_controller.js similarity index 100% rename from app/javascript/packs/controllers/reorder_controller.js rename to app/javascript/controllers/reorder_controller.js diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 2e9bf178..d3e001a8 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -17,13 +17,7 @@ import 'core-js/stable' import 'regenerator-runtime/runtime' - -import { Application } from 'stimulus' -import { definitionsFromContext } from "stimulus/webpack-helpers" - -const application = Application.start() -const context = require.context("./controllers", true, /\.js$/) -application.load(definitionsFromContext(context)) +import 'controllers' import {EditorState} from "prosemirror-state" import {EditorView} from "prosemirror-view"