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

[dir] placeholder for output.assetFileNames #5413

Open
vveisard opened this issue Mar 1, 2024 · 3 comments
Open

[dir] placeholder for output.assetFileNames #5413

vveisard opened this issue Mar 1, 2024 · 3 comments

Comments

@vveisard
Copy link

vveisard commented Mar 1, 2024

Feature Use Case

My use case is to preserve the path of output asset without hashing, so that I can reliably locate an asset using its original path.

Feature Proposal

My proposal is to implement the [dir] placeholder, (implemented in Bun's bundler: https://bun.sh/docs/bundler#naming) which resolves to the "relative path from the build root to the parent directory of the file".

This is related to #4724, because a plugin could be created which implements this requested feature.

@amengdewo
Copy link

need this feature

@ejhernandez913
Copy link

Would like have this feature. +1

@lukastaegert
Copy link
Member

The problem is that this information is just not available, see also #4724.
Assets are emitted by plugins using a name of their choosing. The question whether those assets correspond to a file on the disk and which file this is is currently not part of the asset emission API. So this problem cannot be fixed only on Rollup side, Rollup needs to extend its API and all plugins emitting assets need to follow suit. However, there was not yet a proposal how to extend the API that was implemented.

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