Browse Source

If removing import statements, start at the beginning of the actualy import keyword, instead of the beginning of the file (statement.start vs statement.node.start)

rollup-init
Ronald Berner 9 years ago
parent
commit
7b7709eb38
  1. 5
      src/Module.js

5
src/Module.js

@ -451,6 +451,11 @@ export default class Module {
this.statements.forEach( statement => {
if ( !statement.isIncluded ) {
if ( statement.node.type === 'ImportDeclaration' ) {
magicString.remove( statement.node.start, statement.next );
return;
}
magicString.remove( statement.start, statement.next );
return;
}

Loading…
Cancel
Save