[2.x] No longer copy files to site output from the asset bundler command #2011
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.
Abstract
This pull request changes where compiled assets are saved during build. Currently, they go to
_site/media. This request moves them to_mediato better match project structure and simplify the build process as this is unexpected and should just be handled by the build scriptMotivation
Based on the documentation and project structure, I believe
npm run buildshould save assets to_mediadirectory. Here's my reasoning:Our documented conventions establish that:
resources/assetscontains source files that need compilation_mediacontains compiled/minified files_site/mediais the final output directory for serving to usersThis pattern makes sense because:
_mediaacts as a version-controlled cache of compiled assetsphp hyde build, it can simply copy from_mediato_site/media_mediawithout needing to run npm/node_sitedirectory is typically gitignored and meant for final output onlySo while the current Vite config outputs to
_site/mediaand then copies back to_media, I believe the more logical flow would be:resources/assetsinto_mediaphp hyde buildcopies from_mediato_site/mediaThis maintains a cleaner separation of concerns and better matches the documented purpose of each directory.