jwhitley/requirejs-rails — Issue #27: How are files compiled?
Author: karellm
Created: 2012-01-14 03:08:08+00:00
State: open

I have a `frontend.js` as a "front controller". It is a module that requires main dependencies (Backbone, Underscore, jQuery...) and do some initializations and then I load the app. Here is a simplified version:

```
require([
'jquery',
], function($, Underscore, UnderscoreString, Backbone) {

$(function() {

// Some initializations

require([
'modules/layout/main',
'modules/fields/main',
'modules/forms/main',
], function() {
console.log('app loaded');
});

});
});
```

It works perfectly in dev but in production after I precompiled my assets, I get the following error: `/assets/modules/forms/main.js Failed to load resource: the server responded with a status of 404 (Not Found)`. Do you know what is happening? Do I actually need to declare my modules as modules in my `config/requirejs.yml`?