• 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: './', //这行是改变的
    }
    
  • 相关阅读:
    强化学习 | D3QN原理及代码实现
    Airtest入门及多设备管理总结
    JS图片base64压缩
    ABP框架
    .net gof23种设计模式
    VS2013添加Socket
    VS2013用InstallShield打包winfrom项目
    .net core3.1 log4net无法写日志
    git commit 修改提交说明信息
    screen 使用总结
  • 原文地址:https://www.cnblogs.com/caoxueyang/p/13041807.html
Copyright © 2020-2023  润新知