How to get stimulusjs working?

Any tutorials about how to get stimulusjs integrated into a Phoenix project?

Thanks!

I have it working on a Phoenix project using Webpack, worked out of the box following their install documentation.

1 Like

But Phoenix uses Brunch, no? I’d like to get it working with as vanilla Phoenix as possible.

It does use Brunch, whether you stick with that is totally up to you. Stimulus comes set up for Webpack which is why I made the switch.

You can always follow the guide at https://stimulusjs.org/handbook/installing#using-without-a-build-system to see if you like it enough to make the switch.

You may be interested to see this: https://github.com/phoenixframework/phoenix/pull/2779

Webpack is now the default.

4 Likes