首页 > 其他分享 >vue配置https

vue配置https

时间:2023-07-13 22:35:00浏览次数:37  
标签:__ vue ca 配置 fs https path dirname

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: {
          '^/': '/',
        },
      },
    },
  },
};

  

标签:__,vue,ca,配置,fs,https,path,dirname
From: https://www.cnblogs.com/gongxianjin/p/17552368.html

相关文章

  • Vue基础
    创建实例<divid="app"><!--这里将来会编写一些用于渲染的代码逻辑-->{{msg}}</div><!--引入的是开发版本包,包含完整的注释和警告--><scriptsrc="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script><script>//一旦......
  • Vue3+Vue-Router+TypeScript+Vite+Element-Plus+Axios+Pinia快速搭建开发框架
    1、环境准备(1)首先你得需要安装node和npm2、环境初始化(1)先随意找个文件夹,初始化vite#安装pnpmnpmi-gpnpm#初始化vitepnpmcreatevite#安装依赖pnpminstall(2)最后我们执行pnpmrundev3、安装插件(1)Eslint校验代码工具安装eslint#安装eslint......
  • springmvc自动配置原理
    Springboot这个工具中集成了很多框架,每个框架都有一个xxxAutoConfiguration。在自动配置jar包中的Spring.facroties中有很多xxxAutoConfiguration对应的就是,每个xxxAutoConfiguration都对应了一个框架的自动配置。以springmvc框架为例,springmvc框架他对应了一个WebMvcAutoConfi......
  • vue中视频播放组件的安装
    1.在terminal中输入cnpminstallvue-video-player2.安装完成后在main.js中进行配置 importVueCoreVideoPlayerfrom'vue-core-video-player'Vue.use(VueCoreVideoPlayer,{lang:'zh-CN'})3.后续即可正常使用......
  • Cassandra2.0 JNA配置
    Cassandra中通过JNA可以调用Native方法优化Jvm内存,大概意思就是不让操作系统将jvm内存置换到系统swap分区,从而提升jvm内存性能。它有两个用处: Since0.6.2:JNAfor mlockall.ThispreventsLinuxfromswappingoutpartsoftheJVMthataren'taccessedfrequently.ChrisG......
  • Tomcat中配置自定义404错误页面
    (1)%CATALINA_HOME%\conf\web.xml中web-app节点中添加<error-page><error-code>404</error-code><location>/404.html</location></error-page>在webapps下ROOT新增404.html页面<htmllang="en"><head&g......
  • 使用vue3、egg和SQLite开发通用管理后台系统
    使用vue3、egg和SQLite开发通用管理后台系统plaform是一个基于RBAC模型开发的后台管理系统,没有多余的功能。本项目是一个以学习为目的的后台项目,旨在让前端也能充分了解RBAC模型是如何设计的,不建议用于线上,因为未经过充分的测试。项目地址:https://github.com/essay-org/platform......
  • Vue3
    一、创建Vue3.0工程1.使用vue-cli创建官方文档:https://cli.vuejs.org/zh/guide/creating-a-project.html#vue-create##查看@vue/cli版本,确保@vue/cli版本在4.5.0以上vue--version##安装或者升级你的@vue/clinpminstall-g@vue/cli##创建vuecreatevue_test##......
  • ngnix配置
    centos的nginx配置在/usr/share/nginx/htmlUbuntu的nginx配置在/var/www/html 参考资料:https://gitee.com/sqqdcl/downloadd/wikis/pages?sort_id=5893382&doc_id=2890189......
  • vue 模拟滚动条循环滚动
    <template><el-cardclass="card-duty"><template#header><divclass="card-header"><span>重大警情</span></div></template>......