zoukankan      html  css  js  c++  java
  • vue的config配置问题 以及 Refused to load the image 'http://localhost:8080/favicon.ico'

    在文件夹config的index.js中配置dev和build

    打包问题

      dev: {
        // Various Dev Server settings
        host: '127.0.0.1', // can be overwritten by process.env.HOST
        port: 80, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
        // Paths
        assetsSubDirectory: 'static',
        // 相对 绝对路径问题
        assetsPublicPath: '/',
        // proxyTable: {},
        proxyTable: {
          '/api': {
            // 测试
            target: 'http://47.105.107.186:8889',
            // 最新的开发环境
            // target: 'http://192.168.1.156:8889',
            // target: 'http://47.104.71.52:8889',
            // secure: false,  // 如果是https接口,需要配置这个参数
            changeOrigin: true,
            pathRewrite: {
              '^/api': '', //地址重写,省略api 看的格式正确
            }
          },
        },
        autoOpenBrowser: false,
        errorOverlay: true,
        notifyOnErrors: true,
        poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
    
        /**
         * Source Maps
         */
    
        // https://webpack.js.org/configuration/devtool/#development
        devtool: 'cheap-module-eval-source-map',
    
        // If you have problems debugging vue-files in devtools,
        // set this to false - it *may* help
        // https://vue-loader.vuejs.org/en/options.html#cachebusting
        cacheBusting: true,
    
        cssSourceMap: true
      },
    
      build: {
        index: path.resolve(__dirname, '../dist/index.html'),
        assetsSubDirectory: 'static',
        assetsPublicPath: './', //这行是改变的
    }
    
  • 相关阅读:
    【MyBatis】MyBatis实现CRUD操作
    【MyBatis】 MyBatis入门
    【MySQL】MySQL数据库再安装
    我的大数据学习历程
    汇编语言——指令系统
    大数据概论
    Python云端系统开发入门——框架基础
    Perl碎碎念
    Oracle函数之LISTAGG
    如何利用Oracle外部表导入文本文件的数据
  • 原文地址:https://www.cnblogs.com/caoxueyang/p/13041807.html
Copyright © 2011-2022 走看看