Skip to content

Commit

Permalink
allow passing interop through cli - true/false
Browse files Browse the repository at this point in the history
  • Loading branch information
tunnckoCore committed Aug 11, 2017
1 parent 8969272 commit bd39fa3
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 2 deletions.
1 change: 1 addition & 0 deletions bin/src/help.md
Expand Up @@ -28,6 +28,7 @@ Basic options:
--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)
--interop Include interop block (true by default)

Examples:

Expand Down
3 changes: 2 additions & 1 deletion bin/src/run/mergeOptions.js
Expand Up @@ -8,6 +8,7 @@ const equivalents = {
globals: 'globals',
id: 'moduleId',
indent: 'indent',
interop: 'interop',
input: 'entry',
intro: 'intro',
legacy: 'legacy',
Expand Down Expand Up @@ -72,4 +73,4 @@ export default function mergeOptions ( config, command ) {
delete options.dest;

return options;
}
}
9 changes: 9 additions & 0 deletions test/cli/node_modules/foo/lib/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test/cli/node_modules/foo/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions test/cli/node_modules/rollup-config-foo/lib/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test/cli/node_modules/rollup-config-foo/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions test/cli/samples/interop/_config.js
@@ -0,0 +1,4 @@
module.exports = {
description: 'does not include the interop block',
command: 'rollup -i main.js -f cjs --no-interop'
};
5 changes: 5 additions & 0 deletions test/cli/samples/interop/_expected.js
@@ -0,0 +1,5 @@
'use strict';

var chalk = require( 'chalk' );

assert.ok( chalk );
3 changes: 3 additions & 0 deletions test/cli/samples/interop/main.js
@@ -0,0 +1,3 @@
import chalk from 'chalk';

assert.ok( chalk );
2 changes: 1 addition & 1 deletion test/cli/samples/silent/_config.js
@@ -1,5 +1,5 @@
module.exports = {
description: 'does not print warnings with --silent',
command: 'rollup -i main.js -f cjs --silent',
stderr: ``
stderr: ``,
};

0 comments on commit bd39fa3

Please sign in to comment.