Eric Brown - Cal
Eric Brown - Cal

Reputation: 14379

Change package.json in vue project to do custom build mode

Is this the correct way to change my vue 2 package.json serve script to compile under a new custom build mode "devserver"?

"scripts": {
    "serve": "vue-cli-service lint --fix && vue-cli-service serve --open --mode devserver",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint --fix"
  },

Assuming I have a .env.devserver file in my root folder?

Upvotes: 0

Views: 744

Answers (1)

grovskiy
grovskiy

Reputation: 788

You are doing the right thing, but it is not clear what the problem is. Try this naming

  • env.devserver.local // Compiles and hot-reloads for development
"scripts": {
    "serve": "vue-cli-service lint --fix && vue-cli-service serve --open --mode devserver.local",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint --fix"
},

Upvotes: 1

Related Questions