0

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?

1
  • I was just trying to verify I was doing it the correct way, and not a horrible hack. Commented Sep 16, 2021 at 15:38

1 Answer 1

1

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"
},
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! didn't know that non local didn't hot reload.

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.