From 1fe523ce07cd0b5a5ad6cb6dde26a94d85ebc5dc Mon Sep 17 00:00:00 2001 From: baarkerlounger <5101747+baarkerlounger@users.noreply.github.com> Date: Wed, 8 Dec 2021 10:30:57 +0000 Subject: [PATCH] Fix active admin (#152) * Fix active admin * Use env webpacker css settings except for rspec * Extracting css is default here --- config/initializers/active_admin.rb | 7 +++++++ config/webpacker.yml | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config/initializers/active_admin.rb b/config/initializers/active_admin.rb index 6e78e39d6..b3a9e16af 100644 --- a/config/initializers/active_admin.rb +++ b/config/initializers/active_admin.rb @@ -333,3 +333,10 @@ ActiveAdmin.setup do |config| # config.use_webpacker = true end + +# Print stylesheet is no longer a separate stylesheet in upstream so we can +# delete this when the next version bump is released but for now it prevents +# webpacker issues. +Rails.application.config.after_initialize do + ActiveAdmin.application.stylesheets.delete('active_admin/print.css') +end diff --git a/config/webpacker.yml b/config/webpacker.yml index 449493752..ddb4028d5 100644 --- a/config/webpacker.yml +++ b/config/webpacker.yml @@ -16,7 +16,7 @@ default: &default cache_manifest: false # Extract and emit a css file - extract_css: false + extract_css: true static_assets_extensions: - .jpg @@ -79,14 +79,14 @@ test: # Compile test packs to a separate directory public_output_path: packs-test + # Extract and emit a css file + extract_css: false + production: <<: *default # Production depends on precompilation of packs prior to booting for performance. compile: false - # Extract and emit a css file - extract_css: true - # Cache manifest.json for performance cache_manifest: true