@@ -36,6 +36,9 @@ exports.options = {
3636 "stripDefine" : {
3737 default : false
3838 , describe : "strip all definitions in generated source"
39+ } ,
40+ "stubModules" : {
41+ describe : "Specify modules to stub out in the optimized file [requirejs only]"
3942 }
4043} ;
4144
@@ -364,7 +367,8 @@ exports.build = function (source, dest, options, done) {
364367 stripDefine : getStripDefine ( attrs ) ,
365368 mainFile : path . join ( path . dirname ( relativeRootMainSrc ) , path . basename ( relativeRootMainSrc ) ) ,
366369 baseUrl : path . dirname ( relativeRootMainSrc ) ,
367- miniLoader : true
370+ miniLoader : true ,
371+ stubModules : options . stubModules
368372 } ;
369373
370374 } else if ( loader . name === 'seajs' ) {
@@ -407,7 +411,7 @@ exports.build = function (source, dest, options, done) {
407411 if ( loader . embed ) {
408412
409413 var tempPath = file . writeTemp ( mainSrc , content ) ;
410- content = helpers . content ( tempPath ) ;
414+ content = helpers . content ( tempPath , { noMinify : options . noMinify } ) ;
411415
412416 if ( loader . name === 'requirejs' ) {
413417 code = '<script>' + content + '</script>' ;
@@ -425,7 +429,7 @@ exports.build = function (source, dest, options, done) {
425429
426430 } else {
427431 // Minify compiled file by the content helper
428- file . write ( destPath , helpers . content ( destPath ) ) ;
432+ file . write ( destPath , helpers . content ( destPath , { noMinify : options . noMinify } ) ) ;
429433 // rev, and use origin main src when gen src
430434 if ( isRev ( attrs ) ) {
431435 src = path . join ( path . dirname ( mainSrc ) , helpers . rev ( destPath ) ) ;
@@ -642,7 +646,7 @@ exports.build = function (source, dest, options, done) {
642646 function outputHTML ( ) {
643647 var destHTMLContent = buffer . join ( '' ) ;
644648 file . write ( destHTMLPath , destHTMLContent ) ;
645- destHTMLContent = helpers . content ( destHTMLPath ) ;
649+ destHTMLContent = helpers . content ( destHTMLPath , { noMinify : options . noMinify } ) ;
646650 // if there is a xml header, put it on the top of html again
647651 destHTMLContent = xmlHeader + destHTMLContent ;
648652 file . write ( destHTMLPath , destHTMLContent ) ;
0 commit comments