symfony / stimulus-bridge

Stimulus integration bridge for Symfony projects
https://symfony.com/ux
75 stars 15 forks source link

controllers.json file not updating automatically #45

Closed nufaylr closed 2 years ago

nufaylr commented 2 years ago

Hi, when I add a new stimulus controller under the controller's folder, and it's not updating my controllers.json with the new controller I created.

Example :

  1. Under folder i add assets/controllers/test_controller.js
  2. run yarn run dev or yarn run dev --watch
  3. when i open controllers.json cannot see my test_controller under controllers object.

I'm using "symfony/flex": "^1.3.1" and @symfony/stimulus-bridge "^2.0.0". and i have enabled enableStimulusBridge under webpack config.

Many thanks

tgalopin commented 2 years ago

Hello @nufaylr,

That's actually totally normal! The controllers.json file only references the controllers coming from your vendors (so that Webpack can find them). Webpack is able to find your own controllers (the controllers in your assets/controllers directory) very easily: they are automatically included using the require.context syntax in your assets/bootstrap.js file.

I'm closing this as that's expected, but if you have an issue feel free to add elements here :) .