Comments (8)
👍 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.
from breakfast.
As a workaround I used the following in a intra project rake task.
if Rake::Task.task_defined?("assets:precompile")
intended_action = Rake::Task["assets:precompile"].actions[0]
Rake::Task["assets:precompile"].enhance ["breakfast:yarn:install", "breakfast:assets:compile"] do
intended_action
end
end
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
from breakfast.
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.
from breakfast.
Can you give this branch a shot? https://github.com/devlocker/breakfast/compare/rails-5.1-support
In your Gemfile:
gem "breakfast", github: "devlocker/breakfast", branch: "rails-5.1-support"
# Then run
bundle update breakfast
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 node_modules
cache. So I changed up the the rake task.
However, as a consequence you need to move most of devDependencies
in package.json
up to the main dependencies
section.
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 node_modules
cache if the only change is moving packages around, so you may need to do this for 1 deploy (to bust the cache).
heroku config:set NODE_MODULES_CACHE=false
git push heroku master
heroku config:set NODE_MODULES_CACHE=true
from breakfast.
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.
Rails.application.config.assets.paths << Rails.root.join('public', 'assets')
Rails.application.config.assets.precompile += %w( app.js app.css )
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.
from breakfast.
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.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
from breakfast.
Yes I believe so. I have that set in a few apps I'm running this on.
from breakfast.
Fixed with 0.6.3
from breakfast.
Related Issues (17)
- Livereload for slim/haml/rb HOT 4
- Add digests / fingerprints to production assets
- Pull in runtime errors from developer tools
- yarn HOT 1
- Will not run on puma server HOT 7
- Postcss autoprefixer HOT 6
- Production issues HOT 4
- Vue Config Docs missing step. HOT 1
- Sass HOT 3
- ubuntu auto reload not working HOT 11
- ActiveRecord::AdapterNotSpecified: 'staging' database is not configured. HOT 12
- Incorrect Guidelines for Elm in Web page HOT 1
- Wrong Doc: asset_output_folder HOT 1
- No Bottom bar or livereload on macOS HOT 3
- Opal?
- Can Breakfast/Brunch co-exist with Sprockets? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from breakfast.