Browse Source

change option from bundle to cache

ghi-672
Rich Harris 9 years ago
parent
commit
fc7e0f1ce2
  1. 4
      src/Bundle.js
  2. 4
      src/rollup.js
  3. 6
      test/test.js

4
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;
}, {});

4
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 ) {

6
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 );

Loading…
Cancel
Save