Manifester

A simple tool for fetching digested asset names generated by mix phx.digest
. Implemented as a GenServer so it caches the manifest in memory.
Installation
Add to your mix.exs
:
def deps do
[
{:manifester, "~> 1.0"}
]
end
If you’re not using application inference, then add :manifester
to your applications
list.
Usage
Add the Manifester
GenServer to you supervision tree, ideally at the top:
# Define workers and child supervisors to be supervised
children = [
Manifester,
# Repo, Endpoint...
]
and set your application name in config.exs
:
config :manifester, otp_app: :myapp
Replace :myapp
with your application name.
Now you’re good to go!
Manifester
assumes there is a cache_manifest.json
generated
in ./priv/static/
(which is default in Phoenix). If one is available, you can grab
the digested asset name like so:
iex> Manifester.get("js/app.js")
"js/app-53ddc50a336555354d6b3d18b76d8af6.js"
You can use it to generate full URLs when using a CDN or for something else.
About

This project is sponsored by Heresy. We’re always looking for great engineers to join our team, so if you love Elixir, open source and enjoy some challenge, drop us a line and say hello!
License
- Manifester: See LICENSE file.
- “Heresy” name and logo: Copyright © 2018 Heresy Software Ltd