After installing vue cli globally by running npm install -g vue-cli, I have installed all the modules in the project folder "myBlog" by running npm install and can run the project in my local environment by using npm run dev. But when I am going to move this project in the live server is this is the right way to run the batch program (npm run dev) continuously or there are other ways to run the project without running npm run dev continuously?
3 Answers
If you are using the "webpack", "webpack-simple" or "pwa" template there is a dedicated command for creating the production build, which allows a static hosting (with no need to run any npm process in the server):
npm run build
It will create a dist folder which content you can upload to the root of your server.
Some more info about:
"webpack" template: https://vuejs-templates.github.io/webpack/commands.html#npm-run-build
"webpack-simple": https://github.com/vuejs-templates/webpack-simple#webpack-simple
- "pwa": https://github.com/vuejs-templates/pwa#whats-included
Comments
Very simple. To launch a VueJs project, you must type "npm run serve".
3 Comments
npm run serve over npm run build suggested in the top-voted answer?package.json file? I’m trying to make sure your answer is clear and useful to future readers.