1
1
/**
2
- * @license r.js 1.0.5+ Wed, 01 Feb 2012 01:32:55 GMT Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
2
+ * @license r.js 1.0.5+ Mon, 13 Feb 2012 05:57:30 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
*/
@@ -20,7 +20,7 @@ var requirejs, require, define;
20
20
21
21
var fileName , env , fs , vm , path , exec , rhinoContext , dir , nodeRequire ,
22
22
nodeDefine , exists , reqMain , loadedOptimizedLib ,
23
- version = '1.0.5+ Wed, 01 Feb 2012 01:32:55 GMT' ,
23
+ version = '1.0.5+ Mon, 13 Feb 2012 05:57:30 GMT' ,
24
24
jsSuffixRegExp = / \. j s $ / ,
25
25
commandOption = '' ,
26
26
useLibLoaded = { } ,
@@ -102,7 +102,7 @@ var requirejs, require, define;
102
102
}
103
103
104
104
/** vim: et:ts=4:sw=4:sts=4
105
- * @license RequireJS 1.0.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
105
+ * @license RequireJS 1.0.5+ Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
106
106
* Available via the MIT or new BSD license.
107
107
* see: http://github.com/jrburke/requirejs for details
108
108
*/
@@ -112,7 +112,7 @@ var requirejs, require, define;
112
112
113
113
( function ( ) {
114
114
//Change this version number for each release.
115
- var version = "1.0.5" ,
115
+ var version = "1.0.5+ " ,
116
116
commentRegExp = / ( \/ \* ( [ \s \S ] * ?) \* \/ | ( [ ^ : ] | ^ ) \/ \/ ( .* ) $ ) / mg,
117
117
cjsRequireRegExp = / r e q u i r e \( \s * [ " ' ] ( [ ^ ' " \s ] + ) [ " ' ] \s * \) / g,
118
118
currDirRegExp = / ^ \. \/ / ,
@@ -1156,6 +1156,7 @@ var requirejs, require, define;
1156
1156
err = makeError ( "timeout" , "Load timeout for modules: " + noLoads ) ;
1157
1157
err . requireType = "timeout" ;
1158
1158
err . requireModules = noLoads ;
1159
+ err . contextName = context . contextName ;
1159
1160
return req . onError ( err ) ;
1160
1161
}
1161
1162
@@ -8512,14 +8513,16 @@ define('commonJs', ['env!env/file', 'uglifyjs/index'], function (file, uglify) {
8512
8513
* see: http://github.com/jrburke/requirejs for details
8513
8514
*/
8514
8515
8515
- /*jslint regexp: false, plusplus: false , nomen: false, strict: false */
8516
- /*global define: false , require: false */
8516
+ /*jslint plusplus: true , nomen: true */
8517
+ /*global define, require */
8517
8518
8518
8519
8519
8520
define ( 'build' , [ 'lang' , 'logger' , 'env!env/file' , 'parse' , 'optimize' , 'pragma' ,
8520
8521
'env!env/load' , 'requirePatch' ] ,
8521
8522
function ( lang , logger , file , parse , optimize , pragma ,
8522
8523
load , requirePatch ) {
8524
+ 'use strict' ;
8525
+
8523
8526
var build , buildBaseConfig ,
8524
8527
endsWithSemiColonRegExp = / ; \s * $ / ;
8525
8528
@@ -9040,32 +9043,25 @@ function (lang, logger, file, parse, optimize, pragma,
9040
9043
* to the absFilePath passed in.
9041
9044
*/
9042
9045
build . makeAbsConfig = function ( config , absFilePath ) {
9043
- var props , prop , i , originalBaseUrl ;
9046
+ var props , prop , i ;
9044
9047
9045
9048
props = [ "appDir" , "dir" , "baseUrl" ] ;
9046
9049
for ( i = 0 ; ( prop = props [ i ] ) ; i ++ ) {
9047
9050
if ( config [ prop ] ) {
9048
9051
//Add abspath if necessary, make sure these paths end in
9049
9052
//slashes
9050
9053
if ( prop === "baseUrl" ) {
9051
- originalBaseUrl = config . baseUrl ;
9054
+ config . originalBaseUrl = config . baseUrl ;
9052
9055
if ( config . appDir ) {
9053
9056
//If baseUrl with an appDir, the baseUrl is relative to
9054
9057
//the appDir, *not* the absFilePath. appDir and dir are
9055
9058
//made absolute before baseUrl, so this will work.
9056
- config . baseUrl = build . makeAbsPath ( originalBaseUrl , config . appDir ) ;
9057
- //Set up dir output baseUrl.
9058
- config . dirBaseUrl = build . makeAbsPath ( originalBaseUrl , config . dir ) ;
9059
+ config . baseUrl = build . makeAbsPath ( config . originalBaseUrl , config . appDir ) ;
9059
9060
} else {
9060
9061
//The dir output baseUrl is same as regular baseUrl, both
9061
9062
//relative to the absFilePath.
9062
9063
config . baseUrl = build . makeAbsPath ( config [ prop ] , absFilePath ) ;
9063
- config . dirBaseUrl = config . dir || config . baseUrl ;
9064
9064
}
9065
-
9066
- //Make sure dirBaseUrl ends in a slash, since it is
9067
- //concatenated with other strings.
9068
- config . dirBaseUrl = endsWithSlash ( config . dirBaseUrl ) ;
9069
9065
} else {
9070
9066
config [ prop ] = build . makeAbsPath ( config [ prop ] , absFilePath ) ;
9071
9067
}
@@ -9138,12 +9134,13 @@ function (lang, logger, file, parse, optimize, pragma,
9138
9134
var config = { } , buildFileContents , buildFileConfig , mainConfig ,
9139
9135
mainConfigFile , prop , buildFile , absFilePath ;
9140
9136
9141
- lang . mixin ( config , buildBaseConfig ) ;
9142
- lang . mixin ( config , cfg , true ) ;
9143
-
9144
9137
//Make sure all paths are relative to current directory.
9145
9138
absFilePath = file . absPath ( '.' ) ;
9146
- build . makeAbsConfig ( config , absFilePath ) ;
9139
+ build . makeAbsConfig ( cfg , absFilePath ) ;
9140
+ build . makeAbsConfig ( buildBaseConfig , absFilePath ) ;
9141
+
9142
+ lang . mixin ( config , buildBaseConfig ) ;
9143
+ lang . mixin ( config , cfg , true ) ;
9147
9144
9148
9145
if ( config . buildFile ) {
9149
9146
//A build file exists, load it to get more config.
@@ -9205,6 +9202,19 @@ function (lang, logger, file, parse, optimize, pragma,
9205
9202
//args should take precedence over build file values.
9206
9203
mixConfig ( config , cfg ) ;
9207
9204
9205
+
9206
+ //Set final output dir
9207
+ if ( config . hasOwnProperty ( "baseUrl" ) ) {
9208
+ if ( config . appDir ) {
9209
+ config . dirBaseUrl = build . makeAbsPath ( config . originalBaseUrl , config . dir ) ;
9210
+ } else {
9211
+ config . dirBaseUrl = config . dir || config . baseUrl ;
9212
+ }
9213
+ //Make sure dirBaseUrl ends in a slash, since it is
9214
+ //concatenated with other strings.
9215
+ config . dirBaseUrl = endsWithSlash ( config . dirBaseUrl ) ;
9216
+ }
9217
+
9208
9218
//Check for errors in config
9209
9219
if ( config . cssIn && ! config . out ) {
9210
9220
throw new Error ( "ERROR: 'out' option missing." ) ;
@@ -9222,10 +9232,11 @@ function (lang, logger, file, parse, optimize, pragma,
9222
9232
' or baseUrl directories optimized.' ) ;
9223
9233
}
9224
9234
9225
- if ( config . out && ! config . cssIn ) {
9226
- //Just one file to optimize.
9227
-
9228
- //Set up dummy module layer to build.
9235
+ if ( config . name && ! config . modules ) {
9236
+ //Just need to build one file, but may be part of a whole appDir/
9237
+ //baseUrl copy, but specified on the command line, so cannot do
9238
+ //the modules array setup. So create a modules section in that
9239
+ //case.
9229
9240
config . modules = [
9230
9241
{
9231
9242
name : config . name ,
@@ -9235,6 +9246,10 @@ function (lang, logger, file, parse, optimize, pragma,
9235
9246
excludeShallow : config . excludeShallow
9236
9247
}
9237
9248
] ;
9249
+ }
9250
+
9251
+ if ( config . out && ! config . cssIn ) {
9252
+ //Just one file to optimize.
9238
9253
9239
9254
//Does not have a build file, so set up some defaults.
9240
9255
//Optimizing CSS should not be allowed, unless explicitly
0 commit comments