当使用' dir'时,r.js会排除非构建层文件。和'模块'

时间:2012-12-21 14:05:02

标签: requirejs r.js

我的项目结构非常复杂,它混合了jsp / js / css文件。

在build.js中我使用'dir'和'modules',输出文件夹包含从baseUrl开始的所有内容,它是数千个文件和文件夹,但我只需要在'modules'指令中指定的几个构建层文件,< / p>

有没有办法不将非构建层文件复制到'dir'文件夹中?

2 个答案:

答案 0 :(得分:0)

使用

skipDirOptimize: true

排除所有非构建层文件。然后,r.js将仅优化(和复制)构建层(构建脚本的modules部分)。

请参阅文档中的the example.build.js文件。

答案 1 :(得分:0)

迟到的答案,但您可以尝试removeCombined选项。见https://github.com/jrburke/r.js/blob/master/build/example.build.js#L349

以下是网址

的摘录
//If set to true, any files that were combined into a build bundle will be
//removed from the output folder.
removeCombined: false,
相关问题