了解整个项目的r.js优化器

时间:2014-04-07 05:27:22

标签: javascript backbone.js optimization requirejs rjs

我有一个像这样的目录结构:

assets
  modules
     module1
       models
       templates
       views  //contains individual modules
app.js
build.js
require.js
text.js

这是我的构建资料

({
    paths: {
        jquery: 'assets/js/jquery',
        underscore: 'assets/js/underscore',
        Backbone: 'assets/js/backbone',
        bootstrap:'assets/js/bootstrap',
        flexslider:'assets/js/jquery.flexslider',
        fullCalendar:'assets/js/fullcalendar'
    },
    shim: {
        underscore: {
            exports: "_"
        },
        Backbone: {
            deps: ['underscore', 'jquery'],
            exports: "Backbone"
        },
        flexslider:{
            deps:['jquery'],
            exports:"flexslider"
        },
        fullCalendar:{
            deps:['jquery'],
            exports:"fullCalendar"
        }
    },
    baseUrl : "./",
    name: 'app',
    out: "dist/app.js",
    removeCombined: true,
    findNestedDependencies: true
})

当我运行优化器时,我只在dist文件夹中获取一个app.js文件,它不包含来自modules目录的任何内容。如何优化整个项目?或者我缺乏一些基本的理解?

0 个答案:

没有答案