我有一个像这样的目录结构:
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目录的任何内容。如何优化整个项目?或者我缺乏一些基本的理解?