How to run Vue.js dev serve with https?

后端 未结 7 993
孤独总比滥情好
孤独总比滥情好 2020-12-07 17:20

I\'m using Vue-cli to create vue project with webpack template. how to run it with https in development using: npm run dev?

7条回答
  •  天涯浪人
    2020-12-07 18:09

    If you are using vue ui to serve your application, a simple solution is to replace

     "serve": "vue-cli-service serve",
    

    with

     "serve": "vue-cli-service serve --https true",
    

    in the package.json file of your project.

    Now use vue ui to serve your application. You can make even more changes. See https://cli.vuejs.org/guide/cli-service.html#using-the-binary

提交回复
热议问题