zoukankan      html  css  js  c++  java
  • vue-cli3 配置 vue.config.js

    // vue.config.js
    module.exports = {
      // 选项
      // baseUrl 从 Vue CLI 3.3 起已弃用
      // 部署应用包时的基本 URL
      publicPath: '',
      // 当运行 vue-cli-service build 时生成的生产环境构建文件的目录,默认是dist
      outputDir: 'dist',
      // 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录。
      assetsDir: '',
      // 配置url代理 可配置多个
      devServer: {
        proxy: {
          '/': {
            target: 'http://xxx',
            changeOrigin: true, 
          },
          // 'api': {
          //   target: 'http://www.example.org', // target host //目标主机 
          //   changeOrigin: true, // needed for virtual hosted sites //需要虚拟主机站点 
          //   ws: true, // proxy websockets //代理的WebSockets 
          //   pathRewrite: { //重写路径
          //     '^/api/old-path': '/api/new-path', // rewrite path
          //     '^/api/remove/path': '/path' // remove base path
          //   },
          //   router: { // 路由
          //     // when request.headers.host == 'dev.localhost:3000',
          //     // override target 'http://www.example.org' to 'http://localhost:8000'
          //     'dev.localhost:3000': 'http://localhost:8000'
          //   }
          // }
        }
      }
    }
    

      

  • 相关阅读:
    第一次作业
    习题3 作业
    人工智能原理及其运用习题3.8
    人工智能原理及其应用习题3.5
    人工智能第一次作业
    ASP.NET MVC 之CodeFirst 数据迁移
    实用小程序技巧
    通过Blogilo来写博客园的设置方法
    抢票应用总结
    微信开发--结对编程
  • 原文地址:https://www.cnblogs.com/fczbk/p/12421460.html
Copyright © 2011-2022 走看看