diff --git a/examples/demos/tweetsearch/content/TweetDelegate.qml b/examples/demos/tweetsearch/content/TweetDelegate.qml
index b8953314f15dffaee8181c625ad2f91c4a790691..dfcb3dc7fcc6d6a7f5df980ff55800e7543e2523 100644
--- a/examples/demos/tweetsearch/content/TweetDelegate.qml
+++ b/examples/demos/tweetsearch/content/TweetDelegate.qml
@@ -49,7 +49,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
-import "tweetsearch.js" as Helper
+import "tweetsearch.mjs" as Helper
 
 Item {
     id: container
diff --git a/examples/demos/tweetsearch/content/TweetsModel.qml b/examples/demos/tweetsearch/content/TweetsModel.qml
index 492f85be76ef2aaa9950650a2e3d1d5e10122133..e6001ac30d09dbdf397264fd46998894c1720e78 100644
--- a/examples/demos/tweetsearch/content/TweetsModel.qml
+++ b/examples/demos/tweetsearch/content/TweetsModel.qml
@@ -49,7 +49,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
-import "tweetsearch.js" as Helper
+import "tweetsearch.mjs" as Helper
 
 Item {
     id: wrapper
diff --git a/examples/demos/tweetsearch/content/tweetsearch.js b/examples/demos/tweetsearch/content/tweetsearch.mjs
similarity index 97%
rename from examples/demos/tweetsearch/content/tweetsearch.js
rename to examples/demos/tweetsearch/content/tweetsearch.mjs
index ca6352e6aa68355e6845e31fd0e6b17d1d406e46..3659a390f43ac7257ceeb5a6d48d278009145e13 100644
--- a/examples/demos/tweetsearch/content/tweetsearch.js
+++ b/examples/demos/tweetsearch/content/tweetsearch.mjs
@@ -48,15 +48,13 @@
 **
 ****************************************************************************/
 
-.pragma library
-
-function formatDate(date)
+export function formatDate(date)
 {
     var da = new Date(date)
     return da.toDateString()
 }
 
-function demoToken()
+export function demoToken()
 {
     var a = new Array(22).join('A')
     return a + String.fromCharCode(0x44, 0x69, 0x4a, 0x52, 0x51, 0x41, 0x41, 0x41, 0x41,
@@ -83,7 +81,7 @@ function textForEntity(entity)
            (entity.screen_name ? entity.screen_name : entity.text))
 }
 
-function insertLinks(text, entities)
+export function insertLinks(text, entities)
 {
     if (typeof text !== 'string')
         return "";
diff --git a/examples/demos/tweetsearch/tweetsearch.pro b/examples/demos/tweetsearch/tweetsearch.pro
index 0668d27243e65ae8cb10bd77a4bed394cceb13eb..bc4a09e1ead03e01763bd7af272344bba6555aca 100644
--- a/examples/demos/tweetsearch/tweetsearch.pro
+++ b/examples/demos/tweetsearch/tweetsearch.pro
@@ -6,7 +6,7 @@ RESOURCES += tweetsearch.qrc
 
 OTHER_FILES = tweetsearch.qml \
               content/*.qml \
-              content/*.js \
+              content/*.mjs \
               content/resources/*
 
 target.path = $$[QT_INSTALL_EXAMPLES]/demos/tweetsearch
diff --git a/examples/demos/tweetsearch/tweetsearch.qml b/examples/demos/tweetsearch/tweetsearch.qml
index 40e258d79e34d942ad0b2d40be7a254e9457be2a..8e9ea22afa6f4237a3b48e2e1e013708dd52f997 100644
--- a/examples/demos/tweetsearch/tweetsearch.qml
+++ b/examples/demos/tweetsearch/tweetsearch.qml
@@ -50,7 +50,7 @@
 
 import QtQuick 2.0
 import "content"
-import "content/tweetsearch.js" as Helper
+import "content/tweetsearch.mjs" as Helper
 
 Rectangle {
     id: main
diff --git a/examples/demos/tweetsearch/tweetsearch.qrc b/examples/demos/tweetsearch/tweetsearch.qrc
index b23c3c5537cabb2e4f579d9d46c2c3f946d67694..253be77a2138831088a6317fcc110894752a4bec 100644
--- a/examples/demos/tweetsearch/tweetsearch.qrc
+++ b/examples/demos/tweetsearch/tweetsearch.qrc
@@ -7,7 +7,7 @@
         <file>content/ListHeader.qml</file>
         <file>content/SearchDelegate.qml</file>
         <file>content/TweetDelegate.qml</file>
-        <file>content/tweetsearch.js</file>
+        <file>content/tweetsearch.mjs</file>
         <file>content/TweetsModel.qml</file>
         <file>content/resources/anonymous.png</file>
         <file>content/resources/bird-anim-sprites.png</file>