Upgrade Notes: v0.6.0
Add
SERVE_STATIC_ASSETS="true"to.env.developmentand.env.testin order to serve static assets locally.Add
require 'hanami/rake_tasks'toRakefilein order to enable:preloadand:environmentRake tasksRename
default_formatintodefault_request_formatfor all the applications (eg.apps/web/application.rb)Delete all
serve_assetsoccurrences from all the applications (eg.apps/web/application.rb)Create
public/directory at the root of the project (if not already existing)Add
public/assets*to.gitignoreRename
apps/web/publicintoapps/web/assetsas assets sourcesAdd
require 'hanami/assets'at the top ofapps/web/application.rbAdd
include Web::Assets::Helpersintoview.prepareblock ofapps/web/application.rbChange assets configuration into
apps/web/application.rbfrom:assets << [ # 'vendor/javascripts' ]to:
assets do javascript_compressor :builtin stylesheet_compressor :builtin sources << [ 'assets', # 'vendor/assets' ] endAdd the following code inside the
configure :productionblock ofapps/web/application.rbassets do compile false digest true # CDN Mode (optional) # scheme 'https' # host '123.cloudfront.net' # port 443 end
If you have any problem, don’t hesitate to look for help in chat.