Skip to content

Commit

Permalink
Fixed issue rollup#168
Browse files Browse the repository at this point in the history
When the right side of an export is inside parentheses, the start of the right side ignores the left parenthesis. If we take the left side of the expression, we don't have this problem.
  • Loading branch information
MaartenX committed Feb 25, 2017
1 parent 899bdaf commit 82e7a2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export default function transformCommonjs ( code, id, isEntry, ignoreGlobal, cus

names.push({ name, deconflicted });

magicString.overwrite( node.start, right.start, `var ${deconflicted} = ` );
magicString.overwrite( node.start, left.end, `var ${deconflicted}` );

const declaration = name === deconflicted ?
`export { ${name} };` :
Expand Down

0 comments on commit 82e7a2a

Please sign in to comment.