From 524d7a6fccbdbf1b13efe887e4a4d1cf7d1e5f13 Mon Sep 17 00:00:00 2001 From: cho45 Date: Tue, 1 Oct 2019 23:50:55 +0900 Subject: [PATCH] .mjs is ES module --- .../src/main/java/com/getcapacitor/WebViewLocalServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java b/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java index ed495c8f8..4bf058549 100755 --- a/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java +++ b/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java @@ -326,7 +326,7 @@ private String getMimeType(String path, InputStream stream) { Log.d(LogUtils.getCoreTag(), "We shouldn't be here"); } if (mimeType == null) { - if (path.endsWith(".js")) { + if (path.endsWith(".js") || path.endsWith(".mjs")) { // Make sure JS files get the proper mimetype to support ES modules mimeType = "application/javascript"; } else if (path.endsWith(".wasm")) {