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

feat(assets): assetsFlatten option #17626

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

karlvr
Copy link

@karlvr karlvr commented Jul 7, 2024

Description

Add an option to stop flattening the assets directory when building. On sites with a lot of static assets, it can be nice to preserve the directory structure that the developer created to manage the files... it helps debugging the bundle as the files are in their expected locations (just with a hashed name).

I found this discussion of this topic #2447, and I think this config option solves this nicely.

I have created a test case for this by duplicating the default test case for assets... I wonder if there's a nicer way to do that than to duplicate all of that code... I removed some of the test cases from it that didn't appear relevant... but there's still a lot. I'm happy to try to improve that with some pointers.

Note that I had to modify listAssets to support recursive assets
Copy link

stackblitz bot commented Jul 7, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@patak-dev patak-dev added the p2-to-be-discussed Enhancement under consideration (priority) label Jul 15, 2024
@patak-dev
Copy link
Member

I'll add this proposal to the team board for future discussion. About the tests, I think we shouldn't re-run the whole assets playground for this one. Maybe we could add this config to some of the other playgrounds to avoid creating new ones. But we can wait to see what others think about this feature before that. To be honest, we didn't have much requests so far except for the linked discussion but I agree that not having the complete path to be able to use rollupOptions.output.assetsFileNames is a departure from rollup that may be too opinionated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: build p2-to-be-discussed Enhancement under consideration (priority)
Projects
Status: Discussing
Development

Successfully merging this pull request may close these issues.

None yet

2 participants