Skip to content

Instantly share code, notes, and snippets.

@arackaf
Created June 20, 2016 03:43
Show Gist options
  • Save arackaf/ca054e55cd3b90174309d7ce28d7b84d to your computer and use it in GitHub Desktop.
Save arackaf/ca054e55cd3b90174309d7ce28d7b84d to your computer and use it in GitHub Desktop.
<script src="https://featuretests.io/rs.js"></script>
<script>
var isEs6 = false;
function webSocketAddress(path){
return 'ws://' + window.location.host + (path || '');
}
var isDev = /localhost:3000/.test(window.location.href);
if (isDev){
loadSystemJs();
} else {
new Promise(function (res) {
setTimeout(res, 500);
window["Reflect.supports"]("all", function (results) {
var needed = ['arrow', 'class', 'classes', 'conciseMethodProperty', 'constLoop', 'defaultParameter', 'destructuring',
'forOf', 'generator', 'letConst', 'letLoop', 'letLoopScope', 'letTDZ', 'spreadRest', 'templateString']
isEs6 = !needed.some(function (prop) { return !results[prop] });
res();
});
}).then(loadSystemJs);
}
function loadSystemJs() {
var config = isDev ? systemJsDevConfig : systemJsLiveConfig;
if (!isDev){
config.map['dist-bundles'] = isEs6 ? 'dist-es6' : 'dist-es5';
config.bundles = gBundlePathsTranspiled;
}
System.config(config);
System.import('reactStartup');
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment