group stimulus scripts in an asset subfolder

This commit is contained in:
Tchama 2022-10-01 23:32:05 +02:00
parent aaff9cb482
commit 0953b7ca61
5 changed files with 3 additions and 3 deletions

View File

@ -9,4 +9,4 @@
import './styles/app.css';
// start the Stimulus application
import './bootstrap';
import './stimulus/bootstrap';

View File

@ -11,6 +11,6 @@ import { Controller } from '@hotwired/stimulus';
*/
export default class extends Controller {
connect() {
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js';
this.element.textContent = 'Hello Stimulus! Edit me in assets/stimulus/controllers/hello_controller.js';
}
}

View File

@ -26,7 +26,7 @@ Encore
.addEntry('vue', './assets/vue/index.js')
// enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js)
.enableStimulusBridge('./assets/controllers.json')
.enableStimulusBridge('./assets/stimulus/controllers.json')
// When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
.splitEntryChunks()