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

I am using windows and xampp, wordpress location is localhost/wp/ but can't use sync #20

Open
aboutjquery opened this issue Aug 9, 2024 · 2 comments

Comments

@aboutjquery
Copy link

I try to modify

 "scripts": {
 "sync": "browser-sync start -p 'localhost/wp' --files '**/*.php' 'build/*.js' 'build/*.css'",

But after npm run sync, the URL will jump to http://localhost/%27localhost/wp%27
Weird, what did I do wrong? Thanks

@randysmachado
Copy link

Hi @aboutjquery

On Windows, you need to use the slash to escape and use double quotes, like this: \"localhost/wp\"

Your code will look like this:
"sync": "browser-sync start -p \"localhost/wp\" --files '**/*.php' 'build/*.js' 'build/*.css'",

@BiezdarJS
Copy link

BiezdarJS commented Feb 11, 2025

Don't know about XAMP, but when using WampServer not only 'localhost/wp', the script needs to be adjusted like this:

"sync": "browser-sync start --proxy \"localhost/test\" --open external --files \"**/*.php\" \"build/*.js\" \"build/*.css\""

...in order for the browsersync to refresh the page after changes and saving those changes (ctrl+s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@aboutjquery @randysmachado @BiezdarJS and others