Updated webpack-encore recipe.

This commit is contained in:
Jan Böhmer 2021-10-02 21:23:34 +02:00
parent 9ae8e55b9e
commit ae67b55bf1
7 changed files with 45 additions and 24 deletions

10
assets/bootstrap.js vendored
View file

@ -1,5 +1,11 @@
import { startStimulusApp } from '@symfony/stimulus-bridge';
import '@symfony/autoimport';
// Registers Stimulus controllers from controllers.json and in the controllers/ directory
export const app = startStimulusApp(require.context('./controllers', true, /\.(j|t)sx?$/));
export const app = startStimulusApp(require.context(
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
true,
/\.(j|t)sx?$/
));
// register any custom, 3rd party controllers here
// app.register('some_controller_name', SomeImportedController);