diff --git a/bin/help.md b/bin/help.md index 85aa7e0..7713f67 100644 --- a/bin/help.md +++ b/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 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: diff --git a/bin/runRollup.js b/bin/runRollup.js index 4603c28..74b1135 100644 --- a/bin/runRollup.js +++ b/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' }; diff --git a/test/cli/banner-intro-outro-footer/_config.js b/test/cli/banner-intro-outro-footer/_config.js new file mode 100644 index 0000000..2341f48 --- /dev/null +++ b/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"' +}; diff --git a/test/cli/banner-intro-outro-footer/_expected.js b/test/cli/banner-intro-outro-footer/_expected.js new file mode 100644 index 0000000..ee1aeb3 --- /dev/null +++ b/test/cli/banner-intro-outro-footer/_expected.js @@ -0,0 +1,9 @@ +// banner +(function () { 'use strict'; + + // intro + console.log( 42 ); + // outro + +})(); +// footer diff --git a/test/cli/banner-intro-outro-footer/main.js b/test/cli/banner-intro-outro-footer/main.js new file mode 100644 index 0000000..5c72ff3 --- /dev/null +++ b/test/cli/banner-intro-outro-footer/main.js @@ -0,0 +1 @@ +console.log( 42 );