Created
July 30, 2012 18:00
-
-
Save jiggliemon/3208730 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
<!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> |
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
// 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)) |
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
<h1>You loaded simple</h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment