Let Rails load rev-manifest.json generated by gulp-rev.
Add to your Gemfile:
gem "actionview-rev_manifest"
Run:
bundle install
# config/environments/production.rb
MyApp::Application.config do
config.rev_manifest.enable = true
end
If you want to serve some assets with RevManifest and rest of them with Sprockets, specify all
sources' name, which you want to serve with RevManifest, as config.rev_manifest.sources
:
MyApp::Application.config do
config.rev_manifest.sources = ["new_application.js", "new_application.css"]
end
gulp = require "gulp"
rev = require "gulp-rev"
gulp.task "precompile", ->
gulp.src([
"public/assets/javascripts/*.js",
"public/assets/stylesheets/*.css"
], base: "public")
.pipe(rev())
.pipe(gulp.dest("public"))
.pipe(rev.manifest())
.pipe(gulp.dest("public/assets"))