diff --git a/bin/src/help.md b/bin/src/help.md index 5bd1e5def35..a0977e609db 100644 --- a/bin/src/help.md +++ b/bin/src/help.md @@ -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: diff --git a/bin/src/run/mergeOptions.js b/bin/src/run/mergeOptions.js index 8b12514258f..8e556f265bd 100644 --- a/bin/src/run/mergeOptions.js +++ b/bin/src/run/mergeOptions.js @@ -8,6 +8,7 @@ const equivalents = { globals: 'globals', id: 'moduleId', indent: 'indent', + interop: 'interop', input: 'entry', intro: 'intro', legacy: 'legacy', @@ -72,4 +73,4 @@ export default function mergeOptions ( config, command ) { delete options.dest; return options; -} \ No newline at end of file +} diff --git a/test/cli/node_modules/foo/lib/config.js b/test/cli/node_modules/foo/lib/config.js new file mode 100644 index 00000000000..3cc995e2f4a --- /dev/null +++ b/test/cli/node_modules/foo/lib/config.js @@ -0,0 +1,9 @@ +var replace = require( 'rollup-plugin-replace' ); + +module.exports = { + entry: 'main.js', + format: 'cjs', + plugins: [ + replace({ 'ANSWER': 42 }) + ] +}; diff --git a/test/cli/node_modules/foo/package.json b/test/cli/node_modules/foo/package.json new file mode 100644 index 00000000000..fbd490130d0 --- /dev/null +++ b/test/cli/node_modules/foo/package.json @@ -0,0 +1,3 @@ +{ + "main": "lib/config.js" +} diff --git a/test/cli/node_modules/rollup-config-foo/lib/config.js b/test/cli/node_modules/rollup-config-foo/lib/config.js new file mode 100644 index 00000000000..3cc995e2f4a --- /dev/null +++ b/test/cli/node_modules/rollup-config-foo/lib/config.js @@ -0,0 +1,9 @@ +var replace = require( 'rollup-plugin-replace' ); + +module.exports = { + entry: 'main.js', + format: 'cjs', + plugins: [ + replace({ 'ANSWER': 42 }) + ] +}; diff --git a/test/cli/node_modules/rollup-config-foo/package.json b/test/cli/node_modules/rollup-config-foo/package.json new file mode 100644 index 00000000000..fbd490130d0 --- /dev/null +++ b/test/cli/node_modules/rollup-config-foo/package.json @@ -0,0 +1,3 @@ +{ + "main": "lib/config.js" +} diff --git a/test/cli/samples/interop/_config.js b/test/cli/samples/interop/_config.js new file mode 100644 index 00000000000..d5c2f1bd038 --- /dev/null +++ b/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' +}; diff --git a/test/cli/samples/interop/_expected.js b/test/cli/samples/interop/_expected.js new file mode 100644 index 00000000000..aee3e2f5213 --- /dev/null +++ b/test/cli/samples/interop/_expected.js @@ -0,0 +1,5 @@ +'use strict'; + +var chalk = require( 'chalk' ); + +assert.ok( chalk ); diff --git a/test/cli/samples/interop/main.js b/test/cli/samples/interop/main.js new file mode 100644 index 00000000000..3f6c27fae32 --- /dev/null +++ b/test/cli/samples/interop/main.js @@ -0,0 +1,3 @@ +import chalk from 'chalk'; + +assert.ok( chalk ); diff --git a/test/cli/samples/silent/_config.js b/test/cli/samples/silent/_config.js index 86dfbc1f411..f65374c6e2d 100644 --- a/test/cli/samples/silent/_config.js +++ b/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: ``, };