mix compile.surface (surface v0.7.6) View Source
Generate CSS and JS/TS assets for components.
Setup
Update mix.exs
, adding the :surface
compiler to the list of compilers:
def project do
[
...,
compilers: [:phoenix] ++ Mix.compilers() ++ [:surface]
]
end
Configuration (optional)
The Surface compiler provides some options for custom configuration in your config/dev.exs
.
Options
hooks_output_dir
- defines the folder where the compiler generates the JS hooks files. Default is./assets/js/_hooks/
.only_web_namespace
- instructs the compiler to only search for components defined in the project's web module namespace, e.g.MyAppWeb
. Default isfalse
.
Example
config :surface, :compiler,
hooks_output_dir: "assets/js/surface"
only_web_namespace: true