diff --git a/src/rollup.js b/src/rollup.js index d509bd2..1b171bd 100644 --- a/src/rollup.js +++ b/src/rollup.js @@ -12,6 +12,7 @@ const ALLOWED_KEYS = [ 'banner', 'dest', 'entry', + 'exports', 'external', 'footer', 'format', diff --git a/test/function/exports-flag-allowed-in-options/_config.js b/test/function/exports-flag-allowed-in-options/_config.js new file mode 100644 index 0000000..9fb6472 --- /dev/null +++ b/test/function/exports-flag-allowed-in-options/_config.js @@ -0,0 +1,12 @@ +var assert = require( 'assert' ); + +module.exports = { + description: 'exports flag is passed through to bundle options', + options: { + exports: 'named' + }, + exports: function ( exports ) { + assert.equal( exports.y, 42 ); + assert.ok( !( 'x' in exports ) ); + } +}; diff --git a/test/function/exports-flag-allowed-in-options/foo.js b/test/function/exports-flag-allowed-in-options/foo.js new file mode 100644 index 0000000..a48ffd9 --- /dev/null +++ b/test/function/exports-flag-allowed-in-options/foo.js @@ -0,0 +1 @@ +export var x = 42; diff --git a/test/function/exports-flag-allowed-in-options/main.js b/test/function/exports-flag-allowed-in-options/main.js new file mode 100644 index 0000000..04b166b --- /dev/null +++ b/test/function/exports-flag-allowed-in-options/main.js @@ -0,0 +1 @@ +export { x as y } from './foo'; diff --git a/test/test.js b/test/test.js index 2ccc21c..e4da991 100644 --- a/test/test.js +++ b/test/test.js @@ -76,7 +76,7 @@ describe( 'rollup', function () { return rollup.rollup({ entry: 'x', plUgins: [] }).then( function () { throw new Error( 'Missing expected error' ); }, function ( err ) { - assert.equal( 'Unexpected key \'plUgins\' found, expected one of: banner, dest, entry, external, footer, format, globals, indent, intro, moduleId, moduleName, onwarn, outro, plugins, sourceMap', err.message ); + assert.equal( 'Unexpected key \'plUgins\' found, expected one of: banner, dest, entry, exports, external, footer, format, globals, indent, intro, moduleId, moduleName, onwarn, outro, plugins, sourceMap', err.message ); }); }); }); @@ -149,6 +149,7 @@ describe( 'rollup', function () { // try to generate output try { + if(config.bundleOptions) { console.log(config.bundleOptions); } var result = bundle.generate( extend( {}, config.bundleOptions, { format: 'cjs' }));