1
1
/**
2
- * @license r.js 2.1.1+ Tue, 20 Nov 2012 01:24:24 GMT Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
2
+ * @license r.js 2.1.1+ Tue, 20 Nov 2012 03:36:45 GMT Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
3
3
* Available via the MIT or new BSD license.
4
4
* see: http://github.com/jrburke/requirejs for details
5
5
*/
@@ -21,7 +21,7 @@ var requirejs, require, define;
21
21
22
22
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
23
23
nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode,
24
- version = '2.1.1+ Tue, 20 Nov 2012 01:24:24 GMT',
24
+ version = '2.1.1+ Tue, 20 Nov 2012 03:36:45 GMT',
25
25
jsSuffixRegExp = /\.js$/,
26
26
commandOption = '',
27
27
useLibLoaded = {},
@@ -20533,13 +20533,12 @@ define('rhino/optimize', ['logger', 'env!env/file'], function (logger, file) {
20533
20533
if (arguments.length >= 2) {
20534
20534
accumulator = arguments[1];
20535
20535
} else {
20536
- do {
20537
- if (i in this) {
20538
- accumulator = this[i++];
20539
- break;
20536
+ if (length) {
20537
+ while (!(i in this)) {
20538
+ i++;
20540
20539
}
20540
+ accumulator = this[i++];
20541
20541
}
20542
- while (true);
20543
20542
}
20544
20543
20545
20544
for (; i < length; i++) {
@@ -20973,7 +20972,11 @@ function (lang, logger, envOptimize, file, parse,
20973
20972
buildText += flat.importList.map(function(path){
20974
20973
return path.replace(config.dir, "");
20975
20974
}).join("\n");
20976
- return buildText +"\n";
20975
+
20976
+ return {
20977
+ importList: flat.importList,
20978
+ buildText: buildText +"\n"
20979
+ };
20977
20980
},
20978
20981
20979
20982
/**
@@ -20985,16 +20988,31 @@ function (lang, logger, envOptimize, file, parse,
20985
20988
*/
20986
20989
css: function (startDir, config) {
20987
20990
var buildText = "",
20988
- i, fileName, fileList;
20991
+ importList = [],
20992
+ shouldRemove = config.dir && config.removeCombined,
20993
+ i, fileName, result, fileList;
20989
20994
if (config.optimizeCss.indexOf("standard") !== -1) {
20990
20995
fileList = file.getFilteredFileList(startDir, /\.css$/, true);
20991
20996
if (fileList) {
20992
20997
for (i = 0; i < fileList.length; i++) {
20993
20998
fileName = fileList[i];
20994
20999
logger.trace("Optimizing (" + config.optimizeCss + ") CSS file: " + fileName);
20995
- buildText += optimize.cssFile(fileName, fileName, config);
21000
+ result = optimize.cssFile(fileName, fileName, config);
21001
+ buildText += result.buildText;
21002
+ if (shouldRemove) {
21003
+ result.importList.pop();
21004
+ importList = importList.concat(result.importList);
21005
+ }
20996
21006
}
20997
21007
}
21008
+
21009
+ if (shouldRemove) {
21010
+ importList.forEach(function (path) {
21011
+ if (file.exists(path)) {
21012
+ file.deleteFile(path);
21013
+ }
21014
+ });
21015
+ }
20998
21016
}
20999
21017
return buildText;
21000
21018
},
@@ -22280,7 +22298,7 @@ define('build', function (require) {
22280
22298
22281
22299
//If just have one CSS file to optimize, do that here.
22282
22300
if (config.cssIn) {
22283
- buildFileContents += optimize.cssFile(config.cssIn, config.out, config);
22301
+ buildFileContents += optimize.cssFile(config.cssIn, config.out, config).buildText ;
22284
22302
}
22285
22303
22286
22304
if (typeof config.out === 'function') {
0 commit comments