Skip to content

Commit

Permalink
Set up so we can test with precompiled assets in dev, by passing ASSE…
Browse files Browse the repository at this point in the history
…TS_COMPILED_LIKE_IN_PROD as an env variable
  • Loading branch information
DanielJackson-Oslo committed Jan 28, 2024
1 parent 7bd0aef commit 2859851
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
Rails.application.configure do # rubocop:disable Metrics/BlockLength
# Settings specified here will take precedence over those in config/application.rb.

# Pass in an env variable ASSETS_COMPILED_LIKE_IN_PROD
# to test without assets compiled, like in prod.
# You then need to run
# - yarn build
# - yarn build:css
# - rails assets:precompile
# to get the assets ready before booting the app.
if ENV["ASSETS_COMPILED_LIKE_IN_PROD"].present?
config.assets.compile = false
config.serve_static_files = true
end

# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
Expand Down

0 comments on commit 2859851

Please sign in to comment.