Rails Resources: Precompiling Only One Asset?

We currently have a Rails application, but I have one question regarding resource precompilation.

Every time I edit a single file (stylesheet or javascript file), we must run:
bundle exec rake assets:precompile
... and then download everything again, even those files that have not changed at all.

Is there a way to compile only the edited files and the manifest.yml file?

Thanks in advance.

+4
source share
2 answers

I also had this question, he searched a lot and found one gem called: guard-rails-assets

It compiles assets in a Rails 3.1 application whenever they change.

For example, you can do this:

 # compile ONLY when something changes guard 'rails-assets', :run_on => :change do watch(%r{^app/assets/.+$}) end 

Check out

+4
source

I think that it is not and is not required, because all js files are compiled into a single file, like css files. If you have changed only one file, you have changed such combined files. But, if you want to update a resource file, for example an image, I think you can only place it in the right directory under public / accets

+2
source

Source: https://habr.com/ru/post/1401513/


All Articles