1***@qq.com
1***@qq.com
  • 发布:2020-04-02 10:56
  • 更新:2020-04-02 10:56
  • 阅读:1592

【分享】uniapp打包后html文件里标签不要移除引号

分类:uni-app

在项目根目录新建vue.config.js,添加如下代码。

 chainWebpack: config => {  
        //通过运行 vue inspect plugins 的值html插件别名。。  
        config.plugin('html-index').tap(args => {  
            args[0].minify = {  
                removeAttributeQuotes: false  
            }  
            return args  
        })  
    },

之前按照vue官方文档查的说添加
有的说添加

config.plugin('html').tap

报错说

TypeError: Cannot set property 'minify' of undefined

通过运行

vue inspect plugins

看到插件列表,htmlWebpackPlugin别名改成了html-index

0 关注 分享

要回复文章请先登录注册