View Source mix compile.surface (surface v0.8.4)
Generate CSS and JS/TS assets for components.
setup
Setup
Update mix.exs
, adding the :surface
compiler to the list of compilers:
def project do
[
...,
compilers: [:phoenix] ++ Mix.compilers() ++ [:surface]
]
end
configuration-optional
Configuration (optional)
The Surface compiler provides some options for custom configuration in your config/dev.exs
.
options
Options
hooks_output_dir
- defines the folder where the compiler generates the JS hooks files. Default is./assets/js/_hooks/
.css_output_file
- defines the css file where the compiler generates the code. Default is./assets/css/_components.css
.
example
Example
config :surface, :compiler,
hooks_output_dir: "assets/js/surface",
css_output_file: "assets/css/surface.css"