Can I run `npm run serve` for vue?

Hello everyone :slight_smile:

I would like to know if it’s possible to run npm run serve to launch own app front-end side ?

To code faster or to debug like this : https://vuejs.org/v2/cookbook/debugging-in-vscode.html .

Thanks in advance :slight_smile:

Hey,
I’m not that far into development for nextcloud or vue but I think that will not be possible.

As far as I understand, vue isn’t actually served to the browser, but normal html, css & js. The vue components I guess are just for making sure there is an unified interface by reusing components.
The vue code needs to be build before any changes actually show up (see here)
Because you’re not actually seeing vue in the browser, you can’t debug there.

But I might be wrong, so if anyone could confirm or deny, that would be great!

1 Like

As explained, I also don’t think npm run serve (which is just script that you could define) applies to a php project, unless your npm run serve fires up a php web server. But that would be weird in my opinion.

In fact it is possible using webpack. There, a stub JS file is generated and the corresponding updates in the VUe code will be transmitted over a separate HTTP server provided by webpack. You need to have the NC app hmr_enabler installed.

With Vite I have tried but nit succeeded so far.

Just the current state if anyone stumbles over this topic.