jrburke/requirejs — Issue #178: optimizer: coffeescript build profile and trailing semi-colon
Author: mikeknoop
Created: 2012-02-01 20:05:13+00:00
State: open

This might actually be an issue elsewhere in the tool-chain but I thought I'd check here first.

According to the requirejs optimizer docs, a build profile looks like

```
({
appDir: "../",
baseUrl: "scripts",
dir: "../../appdirectory-build",
modules: [
{
name: "main"
}
]
})
```

Writing that in CoffeeScript (1.2.0) might look simply like
```
appDir: "../",
baseUrl: "scripts",
dir: "../../appdirectory-build",
modules: [
{
name: "main"
}
]
```

Which compiles to (notice trailing semicolon):
```
({
appDir: "../",
baseUrl: "scripts",
dir: "../../appdirectory-build",
modules: [
{
name: "main"
}
]
});
```

And sure enough, I receive an error during optimization.
"Error: Build file /var/www/snapier/media/js/src/app.build.js is malformed: SyntaxError: Unexpected token ;"

Any insight what's going on here? Thanks!