Hi Michael,

This mailing list is for development of Cordova, not for support.
Support questions can be asked on GitHub discussions: https://github.com/apache/cordova/discussions

To quickly answer your question however, cordova-ios@6+ uses the WKWebView.
It does not use any HTTP server. It does use WKSchemeURLHandler to serve content, which behaves similar to an HTTP server but it is NOT an HTTP server. I do not know if it will "handle" the right MIME type out of the box.

I'd probably give it a test using a sample hello world app to see if it will just work. If it doesn't work, adding support might be possible. The area of the code would be in https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/Public/CDVURLSchemeHandler.m#L38 which is responsible for handling URL requests on the scheme and it has an opportunity to set response headers I'm pretty sure.

But I'm also not sure how we can differentiate between a `<script src>` and `<script type="module">`

And if it doesn't work and if you're interesting tackling this issue, then that's exactly what this mailing list is for ;)

Kind regards,
Norman

On 2023-08-16 4:31 p.m., Michael Gatto wrote:
Hi,

I’m trying to confirm if cordova-ios 6.x accommodates es6 modules, both the import 
syntax as well <script type=”module”>.

My previous attempts with the older wkwebviewengine plugin were blocked because 
ES6 modules had to be served from an http server to get the right MIME type, 
else the webview rejects it.

Before I repeat the frustration, has anyone tried this? Does the current 
cordova-ios 6.x use a backend webserver, thus the “localhost” I see in the 
source code (but I’m not seeing anything that looks like an http server…)?


Thanks,
___
Michael Gatto · Lead Mobile Engineer · vinSUITE


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to