Skip to content

Instantly share code, notes, and snippets.

@jiggliemon
Created July 30, 2012 18:00
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 jiggliemon/3208730 to your computer and use it in GitHub Desktop.
Save jiggliemon/3208730 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<script src="js/lib/cajon/cajon.js" async="async"></script>
<script>
(function () {
window.require = {
baseUrl: "js"
,packages: [
,{ name: 'blocks', location: 'lib/blocks/src' }
,{ name: 'yate', location: 'lib/yate/src'}
,{ name: 'yale', location: 'lib/yale/src'}
,{ name: 'yaul', location: 'lib/yaul/src'}
,'simple'
]
,deps:['simple']
,callback: function() {
}
}
}())
</script>
</html>
// CJS Module
// yate loads just fine written in cjs sync style
var Tmpl = require('yate')
// Tmpl is available
/*
this also works fine when written in callback style
require(['yate'], function( Tmpl) {
// Tmpl is available
})
*/
// the template doesn't load written in cjs/sync format (as i would expect)
var template = require('text!tmpl/simple.tmpl')
/*
however it works when written in callback format
require(['text!tmpl/simple.tmpl'], function (theTemplate) {
// theTemplate is a string
})
*/
console.log(new Tmpl(template))
<h1>You loaded simple</h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment