moses toh
moses toh

Reputation: 13192

What is needed to run "npm run build"?

What is needed to run npm run build?

I have project vue

I want to install it to a new server

Do I only need to run npm install?

Upvotes: 1

Views: 11211

Answers (2)

Radu Diță
Radu Diță

Reputation: 14201

Usually npm run build will create a production build.

The build process does a lot of things for you:

  • transpiles JS code
  • bundles code and assets
  • uses cache busting techniques for assets
  • removes dead code

Using the production build is the way to go for production.

Later edit:

You should install npm to be able to run npm commands. You should also run npm install before running npm run build.

Upvotes: 5

karlos
karlos

Reputation: 990

you need package.json that contains :

  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
  }

and also must contains dependencies like this

 "dependencies": {
    "style-loader": "^1.1.4",
    "vue": "^2.6.11",
    "vuex": "^3.3.0"
  },

Upvotes: 1

Related Questions