1

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

在 build.js 中,我使用“dir”和“modules”,输出文件夹包含从 baseUrl 开始的所有内容,它包含数千个文件和文件夹,但我只需要在“modules”指令中指定的少量构建层文件,

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

4

2 回答 2

0

利用

skipDirOptimize: true

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

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

于 2013-04-25T11:17:26.673 回答
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,
于 2015-07-29T05:09:06.993 回答