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:05:17 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:05:17 GMT' ,
24
24
jsSuffixRegExp = / \. j s $ / ,
25
25
commandOption = '' ,
26
26
useLibLoaded = { } ,
@@ -8512,14 +8512,16 @@ define('commonJs', ['env!env/file', 'uglifyjs/index'], function (file, uglify) {
8512
8512
* see: http://github.com/jrburke/requirejs for details
8513
8513
*/
8514
8514
8515
- /*jslint regexp: false, plusplus: false , nomen: false, strict: false */
8516
- /*global define: false , require: false */
8515
+ /*jslint plusplus: true , nomen: true */
8516
+ /*global define, require */
8517
8517
8518
8518
8519
8519
define ( 'build' , [ 'lang' , 'logger' , 'env!env/file' , 'parse' , 'optimize' , 'pragma' ,
8520
8520
'env!env/load' , 'requirePatch' ] ,
8521
8521
function ( lang , logger , file , parse , optimize , pragma ,
8522
8522
load , requirePatch ) {
8523
+ 'use strict' ;
8524
+
8523
8525
var build , buildBaseConfig ,
8524
8526
endsWithSemiColonRegExp = / ; \s * $ / ;
8525
8527
@@ -9040,32 +9042,25 @@ function (lang, logger, file, parse, optimize, pragma,
9040
9042
* to the absFilePath passed in.
9041
9043
*/
9042
9044
build . makeAbsConfig = function ( config , absFilePath ) {
9043
- var props , prop , i , originalBaseUrl ;
9045
+ var props , prop , i ;
9044
9046
9045
9047
props = [ "appDir" , "dir" , "baseUrl" ] ;
9046
9048
for ( i = 0 ; ( prop = props [ i ] ) ; i ++ ) {
9047
9049
if ( config [ prop ] ) {
9048
9050
//Add abspath if necessary, make sure these paths end in
9049
9051
//slashes
9050
9052
if ( prop === "baseUrl" ) {
9051
- originalBaseUrl = config . baseUrl ;
9053
+ config . originalBaseUrl = config . baseUrl ;
9052
9054
if ( config . appDir ) {
9053
9055
//If baseUrl with an appDir, the baseUrl is relative to
9054
9056
//the appDir, *not* the absFilePath. appDir and dir are
9055
9057
//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 ) ;
9058
+ config . baseUrl = build . makeAbsPath ( config . originalBaseUrl , config . appDir ) ;
9059
9059
} else {
9060
9060
//The dir output baseUrl is same as regular baseUrl, both
9061
9061
//relative to the absFilePath.
9062
9062
config . baseUrl = build . makeAbsPath ( config [ prop ] , absFilePath ) ;
9063
- config . dirBaseUrl = config . dir || config . baseUrl ;
9064
9063
}
9065
-
9066
- //Make sure dirBaseUrl ends in a slash, since it is
9067
- //concatenated with other strings.
9068
- config . dirBaseUrl = endsWithSlash ( config . dirBaseUrl ) ;
9069
9064
} else {
9070
9065
config [ prop ] = build . makeAbsPath ( config [ prop ] , absFilePath ) ;
9071
9066
}
@@ -9138,12 +9133,13 @@ function (lang, logger, file, parse, optimize, pragma,
9138
9133
var config = { } , buildFileContents , buildFileConfig , mainConfig ,
9139
9134
mainConfigFile , prop , buildFile , absFilePath ;
9140
9135
9141
- lang . mixin ( config , buildBaseConfig ) ;
9142
- lang . mixin ( config , cfg , true ) ;
9143
-
9144
9136
//Make sure all paths are relative to current directory.
9145
9137
absFilePath = file . absPath ( '.' ) ;
9146
- build . makeAbsConfig ( config , absFilePath ) ;
9138
+ build . makeAbsConfig ( cfg , absFilePath ) ;
9139
+ build . makeAbsConfig ( buildBaseConfig , absFilePath ) ;
9140
+
9141
+ lang . mixin ( config , buildBaseConfig ) ;
9142
+ lang . mixin ( config , cfg , true ) ;
9147
9143
9148
9144
if ( config . buildFile ) {
9149
9145
//A build file exists, load it to get more config.
@@ -9205,6 +9201,19 @@ function (lang, logger, file, parse, optimize, pragma,
9205
9201
//args should take precedence over build file values.
9206
9202
mixConfig ( config , cfg ) ;
9207
9203
9204
+
9205
+ //Set final output dir
9206
+ if ( config . hasOwnProperty ( "baseUrl" ) ) {
9207
+ if ( config . appDir ) {
9208
+ config . dirBaseUrl = build . makeAbsPath ( config . originalBaseUrl , config . dir ) ;
9209
+ } else {
9210
+ config . dirBaseUrl = config . dir || config . baseUrl ;
9211
+ }
9212
+ //Make sure dirBaseUrl ends in a slash, since it is
9213
+ //concatenated with other strings.
9214
+ config . dirBaseUrl = endsWithSlash ( config . dirBaseUrl ) ;
9215
+ }
9216
+
9208
9217
//Check for errors in config
9209
9218
if ( config . cssIn && ! config . out ) {
9210
9219
throw new Error ( "ERROR: 'out' option missing." ) ;
0 commit comments