前端生成二维码时,使用的 qrcode.js 插件
在 webpack 中报错:
_android not work
Cannot read property '_android' of undefine
解决方法:
https://github.com/davidshimjs/qrcodejs/issues/148
https://github.com/davidshimjs/qrcodejs/issues/113
使用 '未压缩包',修改源码:
将:if (this._android && this._android <= 2.1)
改为:if (this && this._android <= 2.1)
据说,还有一种是因为使用了严格模式,'use strict;',把 webpack 打包中的文件里的 use strict 全部移除。
涉及到 webpack 的 babel 插件:
https://www.npmjs.com/package/babel-plugin-transform-remove-strict-mode
我这边使用的是 laravel-mix,配置 webpack 没生效,对整套前端构建不是很熟悉,有时间了再搞,mark 下