Skip to content

Commit c968d11

Browse files
committed
snapshot
1 parent bed7924 commit c968d11

File tree

1 file changed

+45
-35
lines changed

1 file changed

+45
-35
lines changed

dist/r.js

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license r.js 2.1.1+ Sat, 17 Nov 2012 02:00:39 GMT Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
2+
* @license r.js 2.1.1+ Sat, 17 Nov 2012 23:32:03 GMT Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
33
* Available via the MIT or new BSD license.
44
* see: http://github.com/jrburke/requirejs for details
55
*/
@@ -21,7 +21,7 @@ var requirejs, require, define;
2121

2222
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
2323
nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode,
24-
version = '2.1.1+ Sat, 17 Nov 2012 02:00:39 GMT',
24+
version = '2.1.1+ Sat, 17 Nov 2012 23:32:03 GMT',
2525
jsSuffixRegExp = /\.js$/,
2626
commandOption = '',
2727
useLibLoaded = {},
@@ -15080,43 +15080,53 @@ define('build', function (require) {
1508015080
//Get rid of the extension
1508115081
moduleName = moduleName.substring(0, moduleName.length - 3);
1508215082

15083-
//Convert the file to transport format, but without a name
15084-
//inserted (by passing null for moduleName) since the files are
15085-
//standalone, one module per file.
15086-
fileContents = file.readFile(fileName);
15087-
15088-
//For builds, if wanting cjs translation, do it now, so that
15089-
//the individual modules can be loaded cross domain via
15090-
//plain script tags.
15091-
if (config.cjsTranslate) {
15092-
fileContents = commonJs.convert(fileName, fileContents);
15093-
}
15094-
1509515083
//If there is an override for a specific layer build module,
1509615084
//and this file is that module, mix in the override for use
1509715085
//by optimize.jsFile.
1509815086
moduleIndex = getOwn(config._buildPathToModuleIndex, fileName);
1509915087
//Normalize, since getOwn could have returned undefined
1510015088
moduleIndex = moduleIndex === 0 || moduleIndex > 0 ? moduleIndex : -1;
1510115089

15102-
//Only do transport normalization if this is not a build layer
15103-
//and if normalizeDefines indicated all should be done.
15104-
if (moduleIndex === -1 && config.normalizeDefines === "all") {
15105-
fileContents = build.toTransport(config.namespace,
15106-
null,
15107-
fileName,
15108-
fileContents);
15109-
}
15090+
//Try to avoid extra work if the other files do not need to
15091+
//be read. Build layers should be processed at the very
15092+
//least for optimization.
15093+
if (moduleIndex > -1 || !config.skipDirOptimize ||
15094+
config.normalizeDirDefines === "all" ||
15095+
config.cjsTranslate) {
15096+
//Convert the file to transport format, but without a name
15097+
//inserted (by passing null for moduleName) since the files are
15098+
//standalone, one module per file.
15099+
fileContents = file.readFile(fileName);
1511015100

15111-
override = moduleIndex > -1 ?
15112-
config.modules[moduleIndex].override : null;
15113-
if (override) {
15114-
cfg = build.createOverrideConfig(config, override);
15115-
} else {
15116-
cfg = config;
15117-
}
15101+
//For builds, if wanting cjs translation, do it now, so that
15102+
//the individual modules can be loaded cross domain via
15103+
//plain script tags.
15104+
if (config.cjsTranslate) {
15105+
fileContents = commonJs.convert(fileName, fileContents);
15106+
}
15107+
15108+
//Only do transport normalization if this is not a build
15109+
//layer (since it was already normalized) and if
15110+
//normalizeDirDefines indicated all should be done.
15111+
if (moduleIndex === -1 && config.normalizeDirDefines === "all") {
15112+
fileContents = build.toTransport(config.namespace,
15113+
null,
15114+
fileName,
15115+
fileContents);
15116+
}
15117+
15118+
override = moduleIndex > -1 ?
15119+
config.modules[moduleIndex].override : null;
15120+
if (override) {
15121+
cfg = build.createOverrideConfig(config, override);
15122+
} else {
15123+
cfg = config;
15124+
}
1511815125

15119-
optimize.jsFile(fileName, fileContents, fileName, cfg, pluginCollector);
15126+
if (moduleIndex > -1 || !config.skipDirOptimize) {
15127+
optimize.jsFile(fileName, fileContents, fileName, cfg, pluginCollector);
15128+
}
15129+
}
1512015130
});
1512115131

1512215132
//Normalize all the plugin resources.
@@ -15649,13 +15659,13 @@ define('build', function (require) {
1564915659
' pages.');
1565015660
}
1565115661

15652-
//Set up normalizeDefines. If not explicitly set, if optimize "none",
15662+
//Set up normalizeDirDefines. If not explicitly set, if optimize "none",
1565315663
//set to "skip" otherwise set to "all".
15654-
if (!hasProp(config, 'normalizeDefines')) {
15655-
if (config.optimize === 'none') {
15656-
config.normalizeDefines = 'skip';
15664+
if (!hasProp(config, 'normalizeDirDefines')) {
15665+
if (config.optimize === 'none' || config.skipDirOptimize) {
15666+
config.normalizeDirDefines = 'skip';
1565715667
} else {
15658-
config.normalizeDefines = 'all';
15668+
config.normalizeDirDefines = 'all';
1565915669
}
1566015670
}
1566115671

0 commit comments

Comments
 (0)