devlocker / breakfast

Brunch.io with Rails
MIT License
97 stars 11 forks source link

Can Breakfast/Brunch co-exist with Sprockets? #33

Open evenreven opened 4 years ago

evenreven commented 4 years ago

I've recently been working with converting a project gradually from Sprockets to Webpacker, but I'm getting frustrated, and finding Webpack messy, counter-intuitive and full of weird, barely-documented "features".

So I'm trying Breakfast, and it seems promising, but I can't get it to work and Rails complains about app.css not being in the asset pipeline. Could it be that it's because I still have a few assets that are handled by Sprockets? Webpacker and Sprockets can happily co-exist, but since Breakfast uses the same stylesheet_link_tag, I'm starting to suspect this is not the case with Breakfast?

Sorry if this is obvious, but I can't find any mention of this in the docs.

(I think the fact that Breakfast's running as a sub-process of rails s and that it's using the same stylesheet and javascript tags for Rails views are strengths, but I can see if it makes co-existing with Sprockets difficult, and it would make converting my project step by step much harder, sadly.)

PatKoperwas commented 4 years ago

Hey, I've used both side by side and it worked out pretty well. What version of Rails are you running? Last time I tried this was an early 5.x or maybe a late 4.x version of Rails, and I suspect there's a few things I might need to patch up.

evenreven commented 4 years ago

I'm on Rails 5.1.7. Could be that I'm the one doing something wrong. I'll do some more testing.

But, logically, with the same magic keyword (stylesheet_link_tag), wouldn't Sprockets give me an error message regardless? I suspect I'm not even reaching Breakfast because Sprockets fails looking for app.css.

Inversely, how would I even use the Sprockets' application.css?

Sprockets is pretty strict in that manifest files that are called with stylesheet_link_tag has to exist.