Working with WordPress, Vite, Browsersync and LocalWP

Hi everyone

I’ve been playing around with my local setup recently, I’ve tried WordPress Scripts, Webpack, Vite, LocalWp etc and I think I’ve landed on Vite and LocalWP.

I like LocalWP because of its UI, it seems easy to setup and so far it seems to work for me. I’m then using Vite to do the local Development and Production build although I’m not really reaping the benefits from it and rather just using it to compile the files.

I’ve setup browser sync which seems to be working fine, any changes are being recorded and my browser is being updated, my issue is that it’s using localhost:3000. I want to use the local url that LocalWP sets up. I’ve tried setting up a script that opens safari using my LocalWP url but the updates won’t sync. Also, when checking on another computer, I have to use the localhost:3000 again which isn’t ideal.

I’m keen to find out how others are working. I’m not 100% set on using LocalWP and Vite, I just like it.

2 Comments
  1. Are you not able to change browser sync config to point to a different address eg foo.local, which your Local site is likely using?

  2. I can’t quite get what your issue is.. if you need browsersync to proxy requests from example.local then you use the proxy option of browsersync to set it.

    I use gulp with browsersync. I do it like this:

    // Serve task
    export const serve = (done) => {
    server.init({
    proxy: “example.local”,
    });
    done();
    };

    I don’t understand what your issue is with localhost:3000

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer