diff --git a/assets/js/script-early.js b/assets/js/script-early.js
new file mode 100644
index 0000000..7b671f7
--- /dev/null
+++ b/assets/js/script-early.js
@@ -0,0 +1,13 @@
+/**
+ * @file
+ * A JavaScript file for the theme. Runs first, before jQuery etc. have loaded.
+ */
+
+(function () {
+
+ 'use strict';
+
+ // Add a js class to the html-tag when JavsScript is active.
+ document.querySelector('html').classList.replace('nojs', 'js');
+
+})();
diff --git a/assets/js/script.js b/assets/js/script.js
index 8f8fecc..7cfe99d 100644
--- a/assets/js/script.js
+++ b/assets/js/script.js
@@ -7,7 +7,6 @@
'use strict';
- // Add a js class to the html-tag when JavsScript is active.
- $('html').removeClass('nojs').addClass('js');
+ // Place your code here.
})(u);
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index 6e6c01e..33fbe19 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -1,3 +1,5 @@
+{{ $early := resources.Get "js/script-early.js" | minify | fingerprint -}}
+
{{ if $.Param "jquery" -}}
{{ $jquery := resources.Get "js/lib/jquery.slim.min.js" | fingerprint -}}