Skip to content
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

Remove watch script and update start script #164

Merged
merged 4 commits into from
Apr 17, 2023
Merged

Conversation

aurooba
Copy link
Collaborator

@aurooba aurooba commented Apr 16, 2023

Closes #150
Closes #81

I'm not entirely sure why wp-scripts doesn't always detect new files, but I decided to side step it with the existing nodemon setup. Now instead of running npm run watch, you can just run npm run start for a faster development build, which will work anytime a js, css, scss, jsonc, php, or json file is added or changed.

@aurooba aurooba requested a review from bacoords April 16, 2023 06:29
@bacoords
Copy link
Owner

I get this error FYI and running dev:compile opens up the watch (maybe for the theme.json) and leaves it open:

[1] [webpack-cli] Error: Unknown option '--no-watch'
[1] [webpack-cli] Run 'webpack --help' to see available commands and options

@aurooba
Copy link
Collaborator Author

aurooba commented Apr 17, 2023

@bacoords I fixed the part where dev:compile stays open, but I am unable to recreate the error you shared. What script did you get that error on?

@bacoords
Copy link
Owner

bacoords commented Apr 17, 2023

npm run dev:compile which has it as a flag:

"dev:compile": "concurrently \"npm run themejson\" \"wp-scripts start --config ./bin/webpack.config.js --webpack-src-dir=src/blocks --no-watch\"",

But I can confirm the other fix worked

Screenshot 2023-04-17 at 8 09 21 AM

@aurooba
Copy link
Collaborator Author

aurooba commented Apr 17, 2023

Hmm. That's odd. What version of node and npm are you running?

@bacoords
Copy link
Owner

bacoords@MacBook-Pro-5 tangent % node -v
v16.14.0
bacoords@MacBook-Pro-5 tangent % npm -v
8.3.1

@bacoords
Copy link
Owner

The "--no-watch" issue is fixed but was an issue due to webpack (installed as a dependency for wp-scripts) was outdated.

@bacoords bacoords merged commit a726f25 into develop Apr 17, 2023
@bacoords bacoords deleted the fix/webpack-bugs branch April 17, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants