@@ -32,14 +32,15 @@ DojoModuleWrapperPlugin.prototype.apply = function(compiler) {
3232 let chunkKey = Object . keys ( this . options ) ;
3333 chunkKey . map ( ( chunk , key ) => {
3434 const distChunk = this . findFile ( compilation , chunk ) ;
35+ const baseUrl = this . options [ chunk ] . baseUrl || '' ;
3536 const moduleName = this . options [ chunk ] . moduleName || '' ;
3637
3738 let source = compilation . assets [ distChunk ] . source ( ) ;
3839
3940 const depExtractions = source . match ( dependencyExtractorExpr ) ;
4041 const toReplace = source . match ( replacementExpr ) [ 1 ] ;
4142
42- const dojoDeclareLoaderStatement = this . generateStartStatement ( moduleName , depExtractions [ 1 ] , depExtractions [ 2 ] ) ;
43+ const dojoDeclareLoaderStatement = this . generateStartStatement ( moduleName , depExtractions [ 1 ] , depExtractions [ 2 ] , baseUrl , fileNameSuffix ) ;
4344
4445 source = source . replace ( toReplace , "" ) ;
4546 source = source . replace ( endBracketExpr , endBracketString ) ;
@@ -63,7 +64,7 @@ DojoModuleWrapperPlugin.prototype.apply = function(compiler) {
6364 } ) ;
6465} ;
6566
66- DojoModuleWrapperPlugin . prototype . generateStartStatement = function ( moduleName , dependencies , dependencyVariables ) {
67+ DojoModuleWrapperPlugin . prototype . generateStartStatement = function ( moduleName , dependencies , dependencyVariables , baseUrl , fileNameSuffix ) {
6768 var windowDeps = "" ;
6869 var deps = dependencyVariables . split ( "," ) ;
6970 for ( var i = 0 ; i < deps . length ; i ++ ) {
@@ -75,7 +76,7 @@ DojoModuleWrapperPlugin.prototype.generateStartStatement = function(moduleName,
7576 + ' return declare("' + moduleName . replace ( / \/ / g, "." ) + '", null, { \n'
7677 + ' executeBundle: function() {\n'
7778 + windowDeps + '\n'
78- + ' script.get("./ ' + moduleName + postFix + '"); \n'
79+ + ' script.get(' + baseUrl + ' + " ' + moduleName + fileNameSuffix + '"); \n'
7980 + ' } \n'
8081 + ' }); \n'
8182 + '}); \n' ;
0 commit comments