feat(assets): assetsFlatten option #17626
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.