I'm building a very simple app in Roda and for some reason every time I save a css or js file it is compiling the assets and creating a duplication in the public assets folder. I have about 20 of the same css and js file but each with a different asset precompile prefix. Here is the code:
require 'roda'
require_relative './app'
class App < Roda
plugin :render
plugin :assets, css: 'style.scss', js: 'app.js'
compile_assets
route do |r|
r.assets
r.root do
view 'app'
end
end
end
The app server is running with rerun, I don't know if that's relevant.
Any ideas?
Assets plugin relies on SHA digest to name the compiled assets to allow for subresource integrity checks. Every time you make a change in your
app.js
file, the digest will change, so the new file name is generated.You can disable it by setting
sri
option tonil
in the plugin method call:In production you probably want to leave SRI on. Especially if you plan on using a CDN.