diff --git a/src/Bundle.js b/src/Bundle.js index 9ffb0dd..1d9f8d3 100644 --- a/src/Bundle.js +++ b/src/Bundle.js @@ -19,8 +19,8 @@ import { dirname, isRelative, isAbsolute, relative, resolve } from './utils/path export default class Bundle { constructor ( options ) { - if ( typeof options.bundle === 'object' ) { - this.cachedModules = options.bundle.modules.reduce((modules, module) => { + if ( typeof options.cache === 'object' ) { + this.cachedModules = options.cache.modules.reduce((modules, module) => { modules[module.id] = module; return modules; }, {}); diff --git a/src/rollup.js b/src/rollup.js index dc59f1d..4667fae 100644 --- a/src/rollup.js +++ b/src/rollup.js @@ -9,6 +9,7 @@ export const VERSION = '<@VERSION@>'; const ALLOWED_KEYS = [ 'banner', + 'cache', 'dest', 'entry', 'exports', @@ -28,8 +29,7 @@ const ALLOWED_KEYS = [ 'sourceMap', 'targets', 'treeshake', - 'useStrict', - 'bundle' + 'useStrict' ]; export function rollup ( options ) { diff --git a/test/test.js b/test/test.js index d171c45..1191267 100644 --- a/test/test.js +++ b/test/test.js @@ -431,7 +431,7 @@ describe( 'rollup', function () { }); done( error ); } - + else { var expected = sander.readFileSync( '_expected.js' ).toString(); try { @@ -464,7 +464,7 @@ describe( 'rollup', function () { return rollup.rollup({ entry: path.join( INCREMENTAL, 'not-transform-twice', 'main.js' ), plugins: [counter], - bundle + cache: bundle }); }).then( function ( bundle ) { assert.equal( calls, 2 ); @@ -509,7 +509,7 @@ describe( 'rollup', function () { return rollup.rollup({ entry: path.join( INCREMENTAL, 'transform-changed', 'main.js' ), plugins: [counter], - bundle + cache: bundle }); }).then( function ( bundle ) { assert.equal( calls, 3 );