Skip to content

Instantly share code, notes, and snippets.

@crazy4groovy
Last active July 23, 2019 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crazy4groovy/9ce05a572aed8b68ce77c2a080615905 to your computer and use it in GitHub Desktop.
Save crazy4groovy/9ce05a572aed8b68ce77c2a080615905 to your computer and use it in GitHub Desktop.
Example SystemJS usage
{
"imports": {
"lodash": "https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.min.js"
}
}
import _get from "lodash/get";
const name = _get({name: 'Steve'}, '.name')
console.log({name})
document.querySelector('#name').innerText = name
<div id="name">What is my name??</div>
<script>
if (typeof Promise === 'undefined')
document.write('<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.5.5/bluebird.core.min.js"><\/script>')
if (typeof fetch === 'undefined')
document.write('<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/3.0.0/fetch.min.js"><\/script>')
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/4.1.0/system.min.js"
integrity="sha256-i+j3ZmMaI9nPuzasKbNrT3evNnUewPBf5p9UEJdr2zA="
crossorigin="anonymous">
</script>
<script type="systemjs-importmap" src="./imports.json"></script>
<script>
System.import('./main.js')
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment