a***@163.com
a***@163.com
  • 发布:2022-03-24 11:41
  • 更新:2022-11-18 16:21
  • 阅读:1607

文件体积超过500KB的库,怎么让它不跳过,强制编译处理?

分类:uni-app

我需要使用arcgis api的库,按照arcgis官网方式进行npm引入,我至少要用到下面三个库文件:

import Map from "@arcgis/core/Map";
import MapView from "@arcgis/core/views/MapView";
import FeatureLayer from "@arcgis/core/layers/FeatureLayer";

然后每次运行的时候都报错

[警告⚠] node_modules\@arcgis\core\chunks\geometryEngineBase.js 文件体积超过 500KB,已跳过压缩以及 ES6 转 ES5 的处理,手机端使用过大的js库影响性能。
[警告⚠] node_modules\@arcgis\core\chunks\index.js 文件体积超过 500KB,已跳过压缩以及 ES6 转 ES5 的处理,手机端使用过大的js库影响性能。
11:13:24.744 WARNING: Critical dependency: the request of a dependency is an expression

页面上报错:

chunk-vendors.js:2128 [Vue warn]: Error in onReady hook: "TypeError: Cannot read properties of undefined (reading 'lastIndexOf')"

found in

---> at pages/map/map.vue
warn @ chunk-vendors.js:2128
e.config.errorHandler @ chunk-vendors.js:14215
……
显示另外 64 个框架
chunk-vendors.js:14215 [system] TypeError: Cannot read properties of undefined (reading 'lastIndexOf')
at new s (pages-map-map.js:18840:617)
at l._createSuperInternal (pages-map-map.js:17209:24)
at new w (pages-map-map.js:43838:1432)
at l._createSuperInternal (pages-map-map.js:17209:24)
at new l (pages-map-map.js:22099:899)
at l._createSuperInternal (pages-map-map.js:17209:24)
at new u (pages-map-map.js:36078:974)
at l._createSuperInternal (pages-map-map.js:17209:24)
at new l (pages-map-map.js:22099:899)
at l._createSuperInternal (pages-map-map.js:17209:24)

我个人猜测可能是因为arcgis的库没有编译进去。
请问对于超过500KB的库如何让uniapp允许压缩及转换?

2022-03-24 11:41 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com - 90后IT新秀

同样的问题,跳过es6转es5导致代码兼容性有问题,报错了。

潘小白

潘小白 - 前端

uniapp 运行到浏览器 chrome

[警告⚠] node_modules\paypal-checkout\dist\checkout.lib.js 文件体积超过 500KB,已跳过压缩以及 ES6 转 ES5 的处理,手机端使用过大的js库影响性能。

这个怎么解决

j***@163.com

j***@163.com - 小刚

顶一下,我也遇到同样的问题

要回复问题请先登录注册