Vue-CLI為前端項目配置https證書


直入正題,直接在Vue-CLI的vue.config.js文件devServer字段配置:

    // 證書的密碼
    pfxPassphrase: 'xxxx', // when develop with https need to provide server certificate to browser.
    // 證書在本項目下的相對路徑
    pfx: './x/xx.pfx', // https://github.com/gitpod-io/gitpod/issues/26
    // win10 host文件中 對本機IP映射的域名,例如本機IP 192.168.0.22, host文件對該IP的映射域名為 xxx.com
    public: 'xxx.com' // https://stackoverflow.com/questions/43619644/i-am-getting-an-invalid-host-header-message-when-connecting-to-webpack-dev-ser


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM