Module: Alchemy::Sprockets::SkipBuildsCompression

Includes:
SkipBuildsCompression
Included in:
SkipBuildsCompression
Defined in:
lib/alchemy/sprockets/skip_builds_compression.rb

Overview

Alchemy ships pre-built, already-minified admin CSS in app/assets/builds that uses modern CSS syntax (relative colors, oklch() and friends). The legacy SassC/libSass css_compressor — the Sprockets default whenever sassc-rails is present (for example through Solidus) — re-parses every text/css asset as SCSS and raises on that syntax. These files are already minified, so leave them untouched; all other stylesheets still get compressed as before.

Instance Method Summary collapse

Instance Method Details

#call(input) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/alchemy/sprockets/skip_builds_compression.rb', line 21

def call(input)
  builds_path = Alchemy::Engine.root.join("app/assets/builds").to_s
  if input[:filename].to_s.start_with?(builds_path)
    {data: input[:data]}
  else
    super
  end
end