How can i use paths config of requires with Jam?

10 views
Skip to first unread message

Evgeny Sorokin

unread,
Oct 8, 2014, 5:10:28 AM10/8/14
to ja...@googlegroups.com
Hello.

I have a situation when I need to use "paths" config in my application. E.g.:
requirejs.config({
    baseUrl: '',
    paths: {
        modules: 'js/app/modules'
    }
});

So when I define a module: 
define(['backbone', 'modules/user'], function(Backbone, User) {}));
Require JS will load User dependency from url: js/app/modules/user.js

It works fine, but when I am trying to compile my application:
jam compile -i js/app.js dist/public/js/lib/require.js

I got an error:
Error: ENOENT, no such file or directory '/Users/40in/dev/backbone-marionette-boilerplate/public/modules/user.js'

Because the file user.js located in '/Users/40in/dev/backbone-marionette-boilerplate/public/js/app/modules/user.js'

So how can I resolve paths during compile process?

Thank you
Reply all
Reply to author
Forward
0 new messages