diff --git a/symfony/webpack-encore-bundle/1.9/assets/app.js b/symfony/webpack-encore-bundle/1.9/assets/app.js index bb0a6aa13..64dfbe227 100644 --- a/symfony/webpack-encore-bundle/1.9/assets/app.js +++ b/symfony/webpack-encore-bundle/1.9/assets/app.js @@ -9,4 +9,4 @@ import './styles/app.css'; // start the Stimulus application -import './bootstrap'; +import './stimulus_bootstrap'; diff --git a/symfony/webpack-encore-bundle/1.9/assets/bootstrap.js b/symfony/webpack-encore-bundle/1.9/assets/stimulus_bootstrap.js similarity index 81% rename from symfony/webpack-encore-bundle/1.9/assets/bootstrap.js rename to symfony/webpack-encore-bundle/1.9/assets/stimulus_bootstrap.js index 58308a6bf..0960e6c63 100644 --- a/symfony/webpack-encore-bundle/1.9/assets/bootstrap.js +++ b/symfony/webpack-encore-bundle/1.9/assets/stimulus_bootstrap.js @@ -2,7 +2,7 @@ import { startStimulusApp } from '@symfony/stimulus-bridge'; // Registers Stimulus controllers from controllers.json and in the controllers/ directory export const app = startStimulusApp(require.context( - '@symfony/stimulus-bridge/lazy-controller-loader!./controllers', + '@symfony/stimulus-bridge/lazy-controller-loader!./stimulus_controllers', true, /\.(j|t)sx?$/ )); diff --git a/symfony/webpack-encore-bundle/1.9/assets/controllers.json b/symfony/webpack-encore-bundle/1.9/assets/stimulus_controllers.json similarity index 100% rename from symfony/webpack-encore-bundle/1.9/assets/controllers.json rename to symfony/webpack-encore-bundle/1.9/assets/stimulus_controllers.json diff --git a/symfony/webpack-encore-bundle/1.9/assets/controllers/hello_controller.js b/symfony/webpack-encore-bundle/1.9/assets/stimulus_controllers/hello_controller.js similarity index 55% rename from symfony/webpack-encore-bundle/1.9/assets/controllers/hello_controller.js rename to symfony/webpack-encore-bundle/1.9/assets/stimulus_controllers/hello_controller.js index 8c79f65a2..076bc8140 100644 --- a/symfony/webpack-encore-bundle/1.9/assets/controllers/hello_controller.js +++ b/symfony/webpack-encore-bundle/1.9/assets/stimulus_controllers/hello_controller.js @@ -3,14 +3,15 @@ import { Controller } from 'stimulus'; /* * This is an example Stimulus controller! * - * Any element with a data-controller="hello" attribute will cause - * this controller to be executed. The name "hello" comes from the filename: + * Any HTML element with a data-controller="hello" attribute will cause this controller to be executed. Example: + *
+ * The name "hello" comes from the filename: * hello_controller.js -> "hello" * * Delete this file or adapt it for your use! */ 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'; } } diff --git a/symfony/webpack-encore-bundle/1.9/webpack.config.js b/symfony/webpack-encore-bundle/1.9/webpack.config.js index 056b04aa6..b57f3fc63 100644 --- a/symfony/webpack-encore-bundle/1.9/webpack.config.js +++ b/symfony/webpack-encore-bundle/1.9/webpack.config.js @@ -23,7 +23,7 @@ Encore .addEntry('app', './assets/app.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()