vue配置https
const path = require('path'); const fs = require('fs'); const https = require('https'); const options = { key: fs.readFileSync(path.join(__dirname, './ca/client.key')), cert: fs.readFileSync(path.join(__dirname, './ca/client.crt')), ca: fs.readFileSync(path.join(__dirname, './ca/ca_cert.pem')), checkServerIdentity: () => { return null; }, requestCert: true, }; console.log(options) module.exports = { chainWebpack: (config) => { config.module .rule('svg') .exclude.add(path.resolve(__dirname, './src/assets/svgIcon')) .end(); config.module .rule('icons') .test(/\.svg$/) .include.add(path.resolve(__dirname, './src/assets/svgIcon')) .end() .use('svg-sprite-loader') .loader('svg-sprite-loader') .end(); }, css: { loaderOptions: { sass: { prependData: ` @import "@computing/opendesign1/themes/plugins/variable.scss"; @import "@/styles/variable.scss"; `, }, }, }, devServer: { port: 8081, proxy: { '/': { target: 'https://51.38.66.37:30035', ws: true, changeOrigin: true, agent: new https.Agent(options), logLevel: 'debug', pathRewrite: { '^/': '/', }, }, }, }, };
本文来自博客园,作者:易先讯,转载请注明原文链接:https://www.cnblogs.com/gongxianjin/p/17552368.html