我的应用程序一直运行良好,但今天我决定试一试 r.js。
现在我的树(它的一部分)看起来像
- 索引.html
 - 资产
- js
- 需要.js
 - r.js
 - main.js
 - 成分
- 下划线.js
 - jQuery.js
 - 骨干.js
 - jqueryuijs
 
 - 楷模
- 选举.js
 
 - 收藏品
- 选举.js
 
 - 意见
- 应用程序.js
 - 选举.js
 
 
 
 - js
 
在我的 index.html 文件中,我有 
<script data-main="assets/js/main" src="assets/js/require.js"></script>
这是 main.js
require.config({
    paths: {
        jquery: 'http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min',
        underscore: 'components/underscore/underscore-min',
        backbone: 'components/backbone/backbone-min',
        jqueryui: 'components/jqueryui/jquery-ui-1.10.1.custom.min'
    },
    shim: {
        'backbone': {
            deps: ['underscore', 'jquery'],
            exports: 'Backbone'
        },
        'jqueryui': ['jquery']
    }
});
require(['views/app'], function(App) {
    var router = Backbone.Router.extend({
        routes: {
            '': 'root',
            'year(/:year)': 'year'
        },
        root: function() {
            new App();
        },
        year: function(year) {
            new App({
                year: year
            });
        }
    });
    r = new router();
    Backbone.history.start({
        // pushState: true
    });
});
在我的模块中,我指的是我的文件,例如assets/js/views/election.js或assets/js/models/election.js
但是当我用这个 build.js 运行 r.js
({
    // baseUrl: "assets/",
    paths: {
        jquery: 'http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min',
        underscore: 'components/underscore/underscore-min',
        backbone: "components/backbone/backbone-min",
        jqueryui: 'components/jqueryui/jquery-ui-1.10.1.custom.min'
    },
    name: "main",
    out: "main-built.js"
})
我明白了Error: ENOENT, no such file or directory '/Users/alex/Dropbox/www/animated-elections/assets/js/assets/js/collections/elections.js'。我明白这意味着什么,我不明白为什么它会assets/js在我的路径中添加另一个。