maxtaco / coffee-script

IcedCoffeeScript
http://maxtaco.github.com/coffee-script
MIT License
727 stars 58 forks source link

Requiring Iced CoffeeScript using RequireJS causes a ReferenceError #155

Closed paigeruten closed 9 years ago

paigeruten commented 9 years ago

Example:

index.html:

<!doctype html>
<html>
    <head>
        <title>Test</title>
        <script data-main="scripts/main" src="scripts/require.js"></script>
    </head>
    <body>
        <p>Test</p>
    </body>
</html>

scripts/main.js:

requirejs(["iced-coffee-script"], function(icedCoffeeScript) {
    alert(typeof icedCoffeeScript.compile);
});

This will show that Iced CoffeeScript is loaded fine, but the browser reports the error Uncaught ReferenceError: CoffeeScript is not defined on this line. I made a quick fix, but I'm not sure that that line of code is needed at all anymore. Shouldn't browserify take care of setting the CoffeeScript global?