elnovice
I am developing a library of components, how to ship the "compiled" assets?
I am developing a library of components.
Which options I have to ship the compiled css and javascript with it?
Here are some requirements I would love to fulfill:
- My components should be pluggable into any existing Phoenix project (I can assume >= 1.7.0)
- I would love to minimize the steps to be taken to use my library
- I don’t need the library css and javascript to be modified, they can be used as-is
- I would like to don’t have to keep the compiled css and javascript under version control
- It should be possible to use my library as a
pathdependency
Thank you
Marked As Solved
D4no0
Can’t you just place the precompiled css/js in the priv folder and reference them from there?
Also Liked
hubertlepicki
Not necessarily, but that’s what LiveView does. If you don’t keep them in version control, and just build shortly before releasing to hex.pm, then your package will not be usable when pointed to it with {:mylib, github: "some/lib"}. I don’t think there’s a good way to avoid having compiled assets available without committing them to repo.
LostKobrakai
I’d suggest going with the same approach phoenix libraries go with: compile to some retained folder (likely priv/) folder, have a package.json in the root, which references the files. In the end the dependency becomes a npm package like many others.
greven
Phoenix Liveview for example.
https://github.com/phoenixframework/phoenix_live_view/blob/main/package.json
Last Post!
elnovice
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









