From 4cd90dbb43bb60fbfb635dccb78dd6538b255f1a Mon Sep 17 00:00:00 2001 From: Sean Copenhaver Date: Mon, 14 Jan 2013 21:31:33 -0500 Subject: [PATCH] added a no-loader option --- lib/commands/compile.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/commands/compile.js b/lib/commands/compile.js index ab33017..ce8fecd 100644 --- a/lib/commands/compile.js +++ b/lib/commands/compile.js @@ -58,6 +58,10 @@ exports.usage = '\n' + ' and cannot request additional modules.\n' + ' -v, --verbose Increase log level to report all compiled modules\n' + ' --no-minify Do not minify concatenated file with UglifyJS.\n' + + ' --no-loader Do not include a module loader (RequireJS/Almond) or\n' + + ' jam package info. Allows compiling page specific\n' + + ' modules to be used with common modules compiled with\n' + + ' a loader and package info.\n' + ' --no-license Do not include license comments.'; @@ -83,6 +87,7 @@ exports.run = function (settings, _args) { almond: {match: ['-a','--almond']}, verbose: {match: ['-v','--verbose']}, nominify: {match: ['--no-minify']}, + noloader: {match: ['--no-loader']}, nolicense: {match: ['--no-license']} }); @@ -174,7 +179,7 @@ exports.compile = function (opt, callback) { } var includes; - if (opt.almond) { + if (opt.almond || opt.noloader) { includes = opt.includes; } else { @@ -199,6 +204,10 @@ exports.compile = function (opt, callback) { if (opt.nominify) { config.optimize = 'none'; } + if (opt.noloader) { + delete config.name; + delete config.paths; + } if (opt.nolicense) { config.preserveLicenseComments = false; }