Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow addons to extend the contents of the public directory with their own public folder #3617

Closed
JeffersonBledsoe opened this issue Sep 8, 2022 · 4 comments

Comments

@JeffersonBledsoe
Copy link
Member

Is your feature request related to a problem? Please describe.

Currently, for an add-on to add static files, an express middleware needs to be used. While this isn't too much of a problem, it would be nice if add-on development felt the same as frontend development and placing a file in the public directory made it available.

Describe the solution you'd like

Being able to add a file to a public directory inside of an add-on and it be available in the site.

@tiberiuichim
Copy link
Contributor

Based on discussion with Jefferson, we propose the following behavior:

  • an addon can declare a staticResourceOverlay which points to a folder similar to the public folder of a project.
  • these folders are virtually "overlaid" one on top of the other, in the addon declaration order, so that the static resources can be included or overriden

CC @JeffersonBledsoe to confirm this proposal.

@JeffersonBledsoe
Copy link
Member Author

Looks good!

@wesleybl
Copy link
Member

@tiberiuichim I think it's a good idea to overwrite or add public folder URLs. But would the URLs be saved in memory, so you don't have to read the disk with each request?

@davisagli
Copy link
Sponsor Member

A way to do this was added in #6072

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants