Browse Source

Merge pull request #398 from rollup/gh-330

support banner/footer/intro/outro options via CLI
gh-438-b
Oskar Segersvärd 9 years ago
parent
commit
5034714a38
  1. 4
      bin/help.md
  2. 10
      bin/runRollup.js
  3. 5
      test/cli/banner-intro-outro-footer/_config.js
  4. 9
      test/cli/banner-intro-outro-footer/_expected.js
  5. 1
      test/cli/banner-intro-outro-footer/main.js

4
bin/help.md

@ -21,6 +21,10 @@ Basic options:
--no-strict Don't emit a `"use strict";` in the generated modules.
--no-indent Don't indent result
--environment <values> Settings passed to config file (see example)
--intro Content to insert at top of bundle (inside wrapper)
--outro Content to insert at end of bundle (inside wrapper)
--banner Content to insert at top of bundle (outside wrapper)
--footer Content to insert at end of bundle (outside wrapper)
Examples:

10
bin/runRollup.js

@ -74,12 +74,16 @@ module.exports = function ( command ) {
};
var equivalents = {
input: 'entry',
output: 'dest',
name: 'moduleName',
banner: 'banner',
footer: 'footer',
format: 'format',
globals: 'globals',
id: 'moduleId',
input: 'entry',
intro: 'intro',
name: 'moduleName',
output: 'dest',
outro: 'outro',
sourcemap: 'sourceMap'
};

5
test/cli/banner-intro-outro-footer/_config.js

@ -0,0 +1,5 @@
module.exports = {
solo: true,
description: 'adds banner/intro/outro/footer',
command: 'rollup -i main.js -f iife --banner "// banner" --intro "// intro" --outro "// outro" --footer "// footer"'
};

9
test/cli/banner-intro-outro-footer/_expected.js

@ -0,0 +1,9 @@
// banner
(function () { 'use strict';
// intro
console.log( 42 );
// outro
})();
// footer

1
test/cli/banner-intro-outro-footer/main.js

@ -0,0 +1 @@
console.log( 42 );
Loading…
Cancel
Save