V1.3: 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 tasks -
Rename
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.gitignore -
Rename
apps/web/publicintoapps/web/assetsas assets sources -
Add
require 'hanami/assets'at the top ofapps/web/application.rb -
Add
include Web::Assets::Helpersintoview.prepareblock ofapps/web/application.rb -
Change assets configuration into
apps/web/application.rbfrom:assets << [ # 'vendor/javascripts' ]to:
assets do javascript_compressor :builtin stylesheet_compressor :builtin sources << [ 'assets', # 'vendor/assets' ] end -
Add 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 our forum.