From 16570bef499217a34371b1953357a74d64f0499d Mon Sep 17 00:00:00 2001 From: fumimowdan Date: Wed, 18 Oct 2023 14:24:51 +0100 Subject: [PATCH] Keep node_modules for assets --- Dockerfile | 2 +- config/application.rb | 2 -- config/initializers/assets.rb | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3d1e8678..782e2c27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,6 @@ ARG GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID ENV GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID=$GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID RUN bundle exec rake assets:precompile && \ - rm -rf node_modules tmp + rm -rf tmp CMD ./bin/app-startup.sh \ No newline at end of file diff --git a/config/application.rb b/config/application.rb index 8942567c..2948f757 100644 --- a/config/application.rb +++ b/config/application.rb @@ -25,8 +25,6 @@ class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults(7.0) - config.assets.paths << Rails.root.join("node_modules") - config.assets.paths << Rails.root.join("node_modules/govuk-frontend/govuk/assets") config.autoload_paths << Rails.root.join("app/services") # Configuration for the application, engines, and railties goes here. diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 101a2902..d195fb94 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -4,6 +4,8 @@ # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = "1.0" +Rails.application.config.assets.paths << Rails.root.join("node_modules") +Rails.application.config.assets.paths << Rails.root.join("node_modules/govuk-frontend/govuk/assets") # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path