-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assets:precompile runs before breakfast:assets:compile #26
Comments
👍 thank you so much for reporting an issue. You appear to be right for Rails 5.1 >... I believe that shipped with yarn support built in. I'll take a look later tonight and get a fix out in the next day or two. |
As a workaround I used the following in a intra project rake task.
edit: And to add I did need the yarn install. The yarn install I was seeing in heroku was in some other scope or something. Without it brunch wasn't found. ** Thanks for the swift response |
Also if it works for older versions. I think a solid fix would be to pass the two rake task command strings to enhance instead of passing a block with the task object. Although, I'm not sure how older versions will handle it. |
Can you give this branch a shot? https://github.com/devlocker/breakfast/compare/rails-5.1-support In your Gemfile:
I realized that if you're on Heroku and followed the directions for deploying to Heroku then you will indeed have yarn run at least twice. Also, by having Breakfast run it again you miss out on the However, as a consequence you need to move most of Give that a branch a shot - let me know if it works. If it's still funny I can reorder the tasks (so breakfast compiles before the main assets do). I did notice that Heroku doesn't like to bust their
|
I also I created another project using breakfast which reminded me that I had to add the following to assets.rb to get the assets to be found to be served.
I will try to check it out when I can circle back to the original project or deploy the newer project to Heroku. I expect there could be an issue if breakfast is compiling after assets. |
I haven't had a chance to try this, but it came to my attention that all of my workarounds were only side effects of my ignorance of the public_file_server config in my production.rb. I was just working around to get assets to compile the brunch output so that I could serve the files. I just needed to set this configuration manually or though env var. |
Yes I believe so. I have that set in a few apps I'm running this on. |
Fixed with 0.6.3 |
When I began to deploy to Heroku I found that my breakfast assets were always being update one push behind. I did a little digging in the logs and noticed the asset:precompile was being executed before the breakfast:assets and the new version was not being served.
I was able to find the asset:precompile enhancement in breakfast.rake. I was able to instead prepend the tasks breakfast:yarn:install and breakfast:assets:compile by passing them as an array of strings.
I also noticed I was having a duplicate yarn install, but I do not know that it was being initiated though breakfast.
Rails 5.1.4
The text was updated successfully, but these errors were encountered: