Build: Ensure non-JS changes are processed in the watch mode - #30343
Conversation
6a38132 to
b2206ff
Compare
|
This is really nice work, thank you. I can confirm that the CSS consistently compiles for me, when on this branch. Specifically I did first and sure enough, red borders everywhere. Removing it again, gone. I'll let others sanity check the code, but thank you, this is quality of life 👌 |
|
Size Change: 0 B Total Size: 1.42 MB ℹ️ View Unchanged
|
youknowriad
left a comment
There was a problem hiding this comment.
Thank you. Let's keep an eye on the upcoming days on whether the "watch" target change is impactful.
| ].filter( Boolean ), | ||
| watchOptions: { | ||
| ignored: '!packages/*/!(src)/**/*', | ||
| ignored: '!packages/*/build-module/**/*', |
There was a problem hiding this comment.
Actually, this is going to watch everything expect the build-module folder which is the opposite of what we want it seems :P (the key is ignored)
There was a problem hiding this comment.
It's a double negation, we tell ignore everything that isn't in the build-module with ! character 🙃
The API for watchOptions is very simple and doesn't provide the allowed list.
There was a problem hiding this comment.
oh didn't see that ! there
There was a problem hiding this comment.
We will need RegExp to make it work with the PostCSS upgrade, it's even more fun:
ignored: /^(?!.*\/packages\/.*\/build-module\/.*)$/,|
I'm including also a screencast to show that it works. There is a slight delay but I assume it's how long webpack processes the files: Screen.Recording.2021-03-29.at.14.39.24.mov |
|
What a rollercoaster! |
Description
Originally reported by @stokesman in #27821 (comment) after merging #27821 (it was reverted because of the issue reported).
A similar issue was previously reported and this PR should also fix #22645.
In addition to that, there were several reports that changes to SCSS files weren't propagate when using
npm run dev(build in watch mode).Changes proposed
This PR upgrades the version of
CopyWebpackPluginto5.1.2(there are newer versions that work only with webpack 5) and updates the list of ignored files in the watch mode to resolve both issues present.Now that
CopyWebpackPluginensures we watch for changes for all files that it processes, we only need to look at changes applied to the packages inbuild-modulefolder (all production packages are transpiled and have this folder).How has this been tested?
Run
npm run devand make sure that changes to files are reflected in the/buildfolder. I tried changing the following files:packages/*/src/folderblock.jsonin theblock-librarypackageTypes of changes
Bug fix (non-breaking change which fixes an issue).
Checklist:
*.native.jsfiles for terms that need renaming or removal).