Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Jeffxy's avatar

Do i need to npm run build when vue application deployed to server?

How do you guys usually do when going to deploy vue application to production server? Do i need to npm run build every time when changes made? If running npm run build, means that my apps will down until everything compiled?

Is there a way to mitigate this happening when in production server? Thanks!

0 likes
8 replies
Jeffxy's avatar

@Sinnbeck May i know is either one of the method works if my vue app is not within laravel directory for the link you shared?

I think i only can use the third method you mentioned right, if my vue not within laravel directory? Is there any drawback for this?

Sinnbeck's avatar

@Jeffxy Well it depends on your deployment process. How do you deploy?

I assume it is then two apps on different urls? One for laravel and one for the vue app?

Jeffxy's avatar

@Sinnbeck I am using github command to pull latest at my server and run npm run build to deploy it manually.

daniti's avatar

I'm also looking for a solution as well. @jeffxy @kuns25 did you find anything? :)

EDIT: I solved by setting the public folder to a different path (/www) and in the deployment script I just copy everything from /dist after the build cp -a dist/. www/ šŸ‘

Please or to participate in this conversation.