问题
I've been wondering which os/webview versions already support ES6 modules (import/export feature) natively without having to transpile to ES5 via webpack/babel.
Please note that I'm asking about native webview support (for Cordova/PhoneGap) and not for mobile browser support such as Safari or Chrome.
I heard that iOS 10.3 does support it but I'm not sure, also I'm absolutely clueless regarding the current state on Android.
Couldn't find a clear answer googling around. Does someone have exact information on this or at least a link to a resource to read?
回答1:
From what I found out, the current state as of May 2017 is like this:
iOS
UIWebView: No support
WKWebView:
- CORS error when served from file:///
- 403 error when served via local http server plugin in Cordova
- Serving from /external/ works
Android
No support in webview at all
Browsers are a bit better and catch up on support, see https://jakearchibald.com/2017/es-modules-in-browsers/
来源:https://stackoverflow.com/questions/43890272/which-versions-of-ios-and-android-webviews-already-support-es6-modules