vue项目打包后本地index运行

vue-cli项目打包后直接在本机运行,config/index.js 中修改代码

build: {

    // Paths
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    //加了一个小点
    assetsPublicPath: './',
  }

在这里插入图片描述
打包后图标不能用?
build / utils.jsreturn ExtractTextPlugin.extract 返回值中 添加 publicPath: '../../'
在这里插入图片描述

发布了39 篇原创文章 · 获赞 5 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/YYYYYun/article/details/101024012