Skip to content

Instantly share code, notes, and snippets.

@hopeseekr
Created June 25, 2021 03:19
Show Gist options
  • Save hopeseekr/da32c503a58ede2e0b6f70ef2170d3ff to your computer and use it in GitHub Desktop.
Save hopeseekr/da32c503a58ede2e0b6f70ef2170d3ff to your computer and use it in GitHub Desktop.
Conditionally load non-minified JS if needed.
<!DOCTYPE html>
<html lang="en">
<head>
<script src="js/our.min.js"></script>
<!-- Conditionally load the non-minified JS if needed -->
<script>
(function() {
if (typeof SOME_VAR === 'undefined') {
document.write('<script src="js/our.js"><\/script>');
}
})();
</script>
</head>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment