phoenixframework / esbuild

An installer for esbuild
MIT License
271 stars 38 forks source link

Support for resolving module ids that point to assets in Elixir packages #62

Closed pepicrft closed 1 year ago

pepicrft commented 1 year ago

Hi 👋, I'm creating a design system for building Phoenix apps, and I was wondering if it'd be a good idea to extend the functionality of this package to be able to resolve assets that live in Elixir packages, for example in a conventional directory that packages need to comply with. I could take control of the ESBuild configuration myself and do a custom configuration but I thought it'd be useful to have it as functionality in this package, specially for use cases similar to mine.

As an alternative, I could set up another asset pipeline in my package to flatten and give consumers of the package a single CSS and JS, but the process of serving them as static assets from their project endpoints doesn't seem that straightforward (unless I'm missing something).

Thanks folks! If you think it'd make sense to bring that functionality, I'd be happy to make the code contribution myself.

josevalim commented 1 year ago

It really depends on what that entails. The goal of this package is to be a small wrapper around esbuild and we can resolve assets in Elixir packages by pointing NODE_PATH to your deps. If it can also be done as an additional Elixir package, then perhaps that's better too!

pepicrft commented 1 year ago

It really depends on what that entails. The goal of this package is to be a small wrapper around esbuild and we can resolve assets in Elixir packages by pointing NODE_PATH to your deps.

This is exactly what I was looking for :). I missed that piece in the documentation. I'll go ahead with closing this issue.