Created
June 20, 2016 03:43
-
-
Save arackaf/ca054e55cd3b90174309d7ce28d7b84d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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