diff --git a/src/Module.js b/src/Module.js index 11abeca..d015182 100644 --- a/src/Module.js +++ b/src/Module.js @@ -448,7 +448,7 @@ export default class Module { } render ( es ) { - const magicString = this.magicString; + const magicString = this.magicString.clone(); this.statements.forEach( statement => { if ( !statement.isIncluded ) { diff --git a/test/test.js b/test/test.js index 4eb73a6..92a88f0 100644 --- a/test/test.js +++ b/test/test.js @@ -290,10 +290,12 @@ describe( 'rollup', function () { } }, config.options ); - ( config.skip ? describe.skip : config.solo ? describe.only : describe)( dir, () => { + ( config.skip ? describe.skip : config.solo ? describe.only : describe )( dir, () => { + const promise = rollup.rollup( options ); + PROFILES.forEach( profile => { it( 'generates ' + profile.format, () => { - return rollup.rollup( options ).then( bundle => { + return promise.then( bundle => { const options = extend( {}, config.options, { dest: FORM + '/' + dir + '/_actual/' + profile.format + '.js', format: profile.format