Browse Source

--no-indent cli option

better-aggressive
Rich Harris 9 years ago
parent
commit
90ba35b60a
  1. 1
      bin/help.md
  2. 1
      bin/rollup
  3. 3
      bin/runRollup.js
  4. 6
      test/cli/indent-none/_config.js
  5. 9
      test/cli/indent-none/_expected.js
  6. 1
      test/cli/indent-none/main.js
  7. 2
      test/cli/module-name/_config.js

1
bin/help.md

@ -17,6 +17,7 @@ Basic options:
-u, --id ID for AMD module (default is anonymous)
-m, --sourcemap Generate sourcemap (`-m inline` for inline map)
--no-strict Don't emit a `"use strict";` in the generated modules.
--no-indent Don't indent result
Examples:

1
bin/rollup

@ -9,6 +9,7 @@ command = minimist( process.argv.slice( 2 ), {
strict: 'useStrict',
// Short options
d: 'indent',
e: 'external',
f: 'format',
g: 'globals',

3
bin/runRollup.js

@ -58,7 +58,8 @@ function bundle ( options, method ) {
globals: options.globals,
moduleId: options.id,
moduleName: options.name,
sourceMap: options.sourcemap
sourceMap: options.sourcemap,
indent: options.indent !== false
};
if ( options.output ) {

6
test/cli/indent-none/_config.js

@ -0,0 +1,6 @@
var assert = require( 'assert' );
module.exports = {
description: 'disables indentation with --no-indent',
command: 'rollup main.js --format umd --no-indent'
};

9
test/cli/indent-none/_expected.js

@ -0,0 +1,9 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
}(this, function () { 'use strict';
assert.equal( 1 + 1, 2 );
}));

1
test/cli/indent-none/main.js

@ -0,0 +1 @@
assert.equal( 1 + 1, 2 );

2
test/cli/module-name/_config.js

@ -1,4 +1,4 @@
module.exports = {
description: 'generates UMD export with correct moduleName',
command: 'rollup main.js --format umd --name myBundle'
}
};

Loading…
Cancel
Save