bshiluk / vue-wordpress

Use Vue.js and the WP REST API to build WordPress themes as SPAs with dynamic routing, HMR for development, SEO enabled, and SSR capable. Demo:
http://vue-wordpress-demo.bshiluk.com
491 stars 112 forks source link

Cannot run the dev mode (npm run dev) #6

Open michaelscheurer opened 5 years ago

michaelscheurer commented 5 years ago

Hi @bucky355 Thanks for this awesome work you made with this repo. Very interesting aproach. I'll give it a try.

So far it's all working. Except that I can't run the dev mode (meaning: npm run dev). "npm run build" is perfectly working though.

The steps I tried (following your docs): 1.) startet "npm run dev" in the console, where the theme lives (seems to work: "compiled successfully") 2.) edited functions.php as described 3.) I open the url (localhost:8080) and only get a listing with files and folders of the root folder in my WordPress theme.

grafik

What am I doing wrong?

Thanks so much for helping me out.

Cheers

Michael

shubhra14 commented 5 years ago

I don't know how to solve the issue you are facing but I am using WAMP to run wordpress and npm run dev to run the javascipt file. It might be hacky, but it works for me

bshiluk commented 5 years ago

Ya, you would need a local WP set up using XAMP/WAMP or whatever, which is used to serve the site.

The webpack dev server is just used for the live reloading of the JS and CSS files. You wouldn't try and access the dev site through localhost:8080, you would need to use wherever you have your local WP instance set up ( like localhost/wp/my-site )

It is pretty hacky, but it was the only solution I could come up with that was still practical.