Class: HanamiSasso::Configuration
- Inherits:
-
Object
- Object
- HanamiSasso::Configuration
- Defined in:
- lib/hanami-sasso/configuration.rb
Overview
Plugin configuration. Set it from your Rakefile (or a ‘config/sasso.rb` you require) with `HanamiSasso.configure { |c| … }`. Defaults target a stock Hanami 2 layout and compile directly to `public/` (no Node, no esbuild).
Instance Attribute Summary collapse
-
#build_dir ⇒ Object
Returns the value of attribute build_dir.
-
#builds ⇒ Object
Returns the value of attribute builds.
-
#load_paths ⇒ Object
Returns the value of attribute load_paths.
-
#root ⇒ Object
Returns the value of attribute root.
-
#source_dir ⇒ Object
Returns the value of attribute source_dir.
-
#source_map ⇒ Object
Returns the value of attribute source_map.
-
#style ⇒ Object
Returns the value of attribute style.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/hanami-sasso/configuration.rb', line 10 def initialize # { "<input under source_dir>" => "<output under build_dir>" } @builds = { "app.scss" => "app.css" } # nil = :compressed in production (HANAMI_ENV=production), :expanded else. @style = nil # Extra @use/@import dirs; the entrypoint's own dir is always searched. @load_paths = [] @source_dir = "app/assets/css" # Compile straight into public/ so the CSS is served with no Node/esbuild # step; link it with <link href="/assets/css/app.css">. Point this at # "app/assets/css" instead if you'd rather feed Hanami's esbuild pipeline. @build_dir = "public/assets/css" # nil = sidecar .map outside production, off in production; true/false force. @source_map = nil # nil = the working dir when the task runs (the Hanami app root). @root = nil end |
Instance Attribute Details
#build_dir ⇒ Object
Returns the value of attribute build_dir.
8 9 10 |
# File 'lib/hanami-sasso/configuration.rb', line 8 def build_dir @build_dir end |
#builds ⇒ Object
Returns the value of attribute builds.
8 9 10 |
# File 'lib/hanami-sasso/configuration.rb', line 8 def builds @builds end |
#load_paths ⇒ Object
Returns the value of attribute load_paths.
8 9 10 |
# File 'lib/hanami-sasso/configuration.rb', line 8 def load_paths @load_paths end |
#root ⇒ Object
Returns the value of attribute root.
8 9 10 |
# File 'lib/hanami-sasso/configuration.rb', line 8 def root @root end |
#source_dir ⇒ Object
Returns the value of attribute source_dir.
8 9 10 |
# File 'lib/hanami-sasso/configuration.rb', line 8 def source_dir @source_dir end |
#source_map ⇒ Object
Returns the value of attribute source_map.
8 9 10 |
# File 'lib/hanami-sasso/configuration.rb', line 8 def source_map @source_map end |
#style ⇒ Object
Returns the value of attribute style.
8 9 10 |
# File 'lib/hanami-sasso/configuration.rb', line 8 def style @style end |