@@ -41,7 +41,8 @@ define(function (require, exports, module) {
4141 FileUtils = require ( "file/FileUtils" ) ,
4242 Async = require ( "utils/Async" ) ,
4343 ExtensionUtils = require ( "utils/ExtensionUtils" ) ,
44- UrlParams = require ( "utils/UrlParams" ) . UrlParams ;
44+ UrlParams = require ( "utils/UrlParams" ) . UrlParams ,
45+ PathUtils = require ( "thirdparty/path-utils/path-utils" ) ;
4546
4647 // default async initExtension timeout
4748 var INIT_EXTENSION_TIMEOUT = 10000 ;
@@ -61,10 +62,14 @@ define(function (require, exports, module) {
6162 // load the text and i18n modules.
6263 srcPath = srcPath . replace ( / \/ t e s t $ / , "/src" ) ; // convert from "test" to "src"
6364
64- var globalConfig = {
65- "text" : srcPath + "/thirdparty/text/text" ,
66- "i18n" : srcPath + "/thirdparty/i18n/i18n"
67- } ;
65+
66+ // Retrieve the global paths
67+ var globalPaths = brackets . _getGlobalRequireJSConfig ( ) . paths ;
68+
69+ // Convert the relative paths to absolute
70+ Object . keys ( globalPaths ) . forEach ( function ( key ) {
71+ globalPaths [ key ] = PathUtils . makePathAbsolute ( srcPath + "/" + globalPaths [ key ] ) ;
72+ } ) ;
6873
6974 /**
7075 * Returns the full path of the default user extensions directory. This is in the users
@@ -157,8 +162,7 @@ define(function (require, exports, module) {
157162 var extensionConfig = {
158163 context : name ,
159164 baseUrl : config . baseUrl ,
160- /* FIXME (issue #1087): can we pass this from the global require context instead of hardcoding twice? */
161- paths : globalConfig ,
165+ paths : globalPaths ,
162166 locale : brackets . getLocale ( )
163167 } ;
164168
@@ -282,7 +286,7 @@ define(function (require, exports, module) {
282286 var extensionRequire = brackets . libRequire . config ( {
283287 context : name ,
284288 baseUrl : config . baseUrl ,
285- paths : $ . extend ( { } , config . paths , globalConfig )
289+ paths : $ . extend ( { } , config . paths , globalPaths )
286290 } ) ;
287291
288292 extensionRequire ( [ entryPoint ] , function ( ) {
0 commit comments