[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_media
to 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 build
should save assets to_media
directory. Here's my reasoning:Our documented conventions establish that:
resources/assets
contains source files that need compilation_media
contains compiled/minified files_site/media
is the final output directory for serving to usersThis pattern makes sense because:
_media
acts as a version-controlled cache of compiled assetsphp hyde build
, it can simply copy from_media
to_site/media
_media
without needing to run npm/node_site
directory is typically gitignored and meant for final output onlySo while the current Vite config outputs to
_site/media
and then copies back to_media
, I believe the more logical flow would be:resources/assets
into_media
php hyde build
copies from_media
to_site/media
This maintains a cleaner separation of concerns and better matches the documented purpose of each directory.