-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@wordpress/scripts doesn't detect render
PHP files without a restart
#49790
Comments
Thank you for opening this issue, @aurooba. I haven’t tested it yet but I’m quite sure that the issue exists based on the following findings in the code. There is a single place in the webpack config that collects all paths for all
It never gets recalculated in the watch mode, so it doesn't have a chance to detect a new file when processing inside the copy plugin: |
@gziolo That makes sense. I can take a look at this later this week and help fix it. I've been diving into the wp-scripts code to understand it better overall, so I've started to get a good handle on it. |
Fantastic! 😀 |
Fixed with #50939. |
I opened a follow-up #51162 with some performance optimization to the webpack configuration for detecting |
Description
If you have
@wordpress/scripts
running with thestart
script, and add a"render": "file:./render.php"
to yourblock.json
file, the script doesn't detect it. But if you end the process and restart it, then it does.It's very possible I'm just missing something, but I can't figure out why this is happening! I don't recall it being an issue before.
Step-by-step reproduction instructions
npx @wordpress/create-block todo-list
npm run start
render.php
file in thesrc
folder"render": "file:./render.php"
to yourblock.json
file.render.php
never makes it to thebuild
foldernpm run start
again.render.php
now appears in yourbuild
folderScreenshots, screen recording, code snippet
block.json
render.php
Screenshot of the src folder
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: