Adding brunch to existing no-brunch phoenix app

Hello!

Some time ago, i have created a new phoenix project with --no-brunch flag. After some development time, i decided it would actually be pretty good to have the a brunch but it was too late. I also didn’t want to rewrite everything to a newly created app (without specifying --no-brunch flag).

So - is there any way to add a brunch (not from scratch but using an official phoenix configs) to my non-brunch app? I’m coming from a ruby (on rails) world so my first gues if that would be a rails app would be to look for generator files and try to reproduce this by hand. However, that phoenix app i started is my first attempt to learn elixir/phoenix so i’m not yet experienced enough to understand someone’s else code - hope you understand :slight_smile: But i would be more than happy to at least be adviced on where to look for such generator files/code.

Thanks in advance!

I’d generate two new apps. Same name, but one with --no-brunch and one without. Then use a diff generating app to compare the two.

Yeah, that was my idea to do this, i was just hoping there is some built-in generator for this :wink:

You may have a look under the Phoenix Without Brunch section on the Static Assets documentation. I would say you do only need to add a watchers param to your app’s configuration (config/dev.exs) and perhaps copy all the brunch boilerplate from a separate app or configure it manually.

Keep in mind I have not done this myself and might have missed something.