Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Support rollup of only core mojito files
Browse files Browse the repository at this point in the history
  • Loading branch information
redonkulus committed Jun 7, 2012
1 parent 236ec4a commit f37fdb3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions source/lib/management/commands/compile.js
Expand Up @@ -52,6 +52,8 @@ usage = 'mojito compile {options} {type}\n' +
'\t -e : short for --everything\n' +
'\t --clean : clean up all compiled modules\n' +
'\t -c : short for --clean\n' +
'\t --core : compile only mojito core (only applies to rollups)\n' +
'\t -o : short for --core\n' +
'\t --verbose : for verbose output\n' +
'\t -v : short for --verbose\n' +
'\t --port : if a server is started, specify the port\n' +
Expand All @@ -76,6 +78,11 @@ options = [
longName: 'clean',
hasValue: false
},
{
shortName: 'o',
longName: 'core',
hasValue: false
},
{
shortName: 'e',
longName: 'everything',
Expand Down Expand Up @@ -425,7 +432,9 @@ compile.rollups = function(context, options, callback) {
rollupBody = '';
for (i = 0; i < rollup.srcs.length; i += 1) {
src = rollup.srcs[i];
rollupBody += fs.readFileSync(src, 'utf-8');
if (!options['core'] || src.match(/\/mojito\//)) {
rollupBody += fs.readFileSync(src, 'utf-8');
}
}
fs.writeFileSync(rollup.dest, rollupBody, 'utf-8');
if (options.verbose) {
Expand All @@ -434,7 +443,7 @@ compile.rollups = function(context, options, callback) {
processed += 1;
}

if (options.app) {
if (options.app || options.core) {
rollup = store.getRollupsApp('client', context);
rollOneUp(rollup);
utils.log('All rollups have been ' +
Expand Down

0 comments on commit f37fdb3

Please sign in to comment.