Build: Add CSS files in /public/sections
to the watched hot-reload files list
#19228
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.
After #18823 was merged, I noticed that hot-reloading CSS wasn't working in the Store extension anymore. I traced this to a list of watched CSS files,
publicCssFiles
, in/server/bundler/css-hot-reload.js
. The very simple solution I've come to here is just adding the files in/public/sections
to this list as well.There are a few things I noticed, but I don't think they're necessarily problems:
style-debug.css
, even though I'm pretty sure nothing's changed thereThis still doesn't watch the files in
public/sections-rtl
, and at this point I'd suggest either something likerecursive-readdir-sync
, or looping over an array whitelist ofPUBLIC_DIR
s.To test
npm start
/store/:site
(where site is an atomic site)extensions/woocommerce/style.scss
)Building CSS…
,Reloading CSS… <…woocommerce.css