2024-05-04 03:06:15 +02:00
|
|
|
defmodule PhilomenaWeb.Config do
|
2024-06-02 05:35:19 +02:00
|
|
|
# Dialyzer only analyzes beam files directly and cannot see the compile-time variance in
|
|
|
|
# the associated values, so it flags a false positive here.
|
|
|
|
@dialyzer [:no_match]
|
|
|
|
|
2024-05-04 03:06:15 +02:00
|
|
|
@reload_enabled Application.compile_env(:philomena, :vite_reload, false)
|
|
|
|
@csp_relaxed Application.compile_env(:philomena, :csp_relaxed, false)
|
|
|
|
|
|
|
|
defmacro vite_hmr?(do: do_clause, else: else_clause) do
|
|
|
|
if(@reload_enabled, do: do_clause, else: else_clause)
|
|
|
|
end
|
|
|
|
|
|
|
|
defmacro csp_relaxed?(do: do_clause, else: else_clause) do
|
|
|
|
if(@csp_relaxed, do: do_clause, else: else_clause)
|
|
|
|
end
|
|
|
|
end
|