7

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 3

7

It's not Vue specific but you also should be able to run npm run build which generates production bundles in /dist subfolder of your project. You are supposed to copy this folder to the production server and configure the server so that it serves dist/index.html for every URL.

Sign up to request clarification or add additional context in comments.

Comments

4

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:

Comments

0

Very simple. To launch a VueJs project, you must type "npm run serve".

3 Comments

What's the benefit of npm run serve over npm run build suggested in the top-voted answer?
The answer to your question is in the package.json file.
Hmm. Can you expand on that? I’m not following. What am I looking for in the package.json file? I’m trying to make sure your answer is clear and useful to future readers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.