This merge request attempts to lower sdkVersion to:
It also polyfills missing JavaScript functions using core-js and compiles ECMAScript6 syntax to ECMAScript5, including:
However, due to the outdated WebView bundled with Android 5.1 (Chromium 39.0.0) which doesn't support features like dynamic import, ESM Bundles are currently unavailable with this solution. Users on Android 5.1 must either update their system WebView, developers must bundle a Chromium instance in the app, or compile JavaScript from ESM to SystemJS (or CommonJS) using Babel, and use <script nomodule/>
for such WebView.
Note: The usage of Babel is rather rough, as it waits for the entire Vits bundle before transpiling the bundled code to remove new syntax. This may result in a loss of efficiency and disk space. Unfortunately, I couldn't figure out how to integrate Babel with Vits correctly to call Babel after bundle completion but not before, as the bundle process might introduce new syntax.