Skip to content

Instantly share code, notes, and snippets.

@chips5k
Created March 11, 2016 11:18
Show Gist options
  • Save chips5k/191843e868ddf21c7321 to your computer and use it in GitHub Desktop.
Save chips5k/191843e868ddf21c7321 to your computer and use it in GitHub Desktop.
Aurelia bootstrap index.html with cachebusting on dist files only
<!DOCTYPE html>
<html>
<head>
<title>Aurelia</title>
<link rel="stylesheet" href="jspm_packages/npm/[email protected]/css/font-awesome.min.css">
<link href='https://fonts.googleapis.com/css?family=Lato:400,300italic,300,400italic,700,900,900italic,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="styles/styles.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body aurelia-app="main">
<div class="splash">
<div class="message">Aurelia Navigation Skeleton</div>
<i class="fa fa-spinner fa-spin"></i>
</div>
<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script src="config.js"></script>
<script>
var systemLocate = System.locate;
System.locate = function(load) {
var System = this; // its good to ensure exact instance-binding
return Promise.resolve(systemLocate.call(this, load)).then(function(address) {
var tokens = address.split(/\//);
if(tokens[3] == 'dist'){
address += System.cacheBust;
}
return address;
});
}
System.cacheBust = '?bust=' + Date.now();
System.import('aurelia-bootstrapper');
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment