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.
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.