Skip to content

Instantly share code, notes, and snippets.

@dignifiedquire
Created March 20, 2014 10:37
Show Gist options
  • Save dignifiedquire/9661101 to your computer and use it in GitHub Desktop.
Save dignifiedquire/9661101 to your computer and use it in GitHub Desktop.
export var app = {
start: function () {
console.log('Starting application');
},
load: function (module) {
console.log('Loading %s', module);
return System.import(module);
}
};
<html>
<head>
<script src="https://jspm.io/system@0.4.js"></script>
<script>
System.paths['*'] = '/*.js';
System.import('app').then(function (m) {
var app = m.app;
app.start();
return app.load('npm:jquery').then(function (jquery) {
console.log('Loaded jquery');
console.log(jquery);
});
}).catch(function (err) {
console.error(err);
});
</script>
</head>
<body>
</body>
</html>
@dignifiedquire
Copy link
Author

Run:

$ git clone https://gist.github.com/9661101.git modules
$ cd modules
$ npm i -g http-server
$ http-server .
$ open localhost:8080

look at the console output :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment