We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2c8bce commit 8be87d8Copy full SHA for 8be87d8
src/index.js
@@ -157,14 +157,17 @@ function wrapExportsInQuotes(exports, code) {
157
}
158
159
function separateExportsWithCommas(exports, code) {
160
- let codeLines = code.split("\n").map((line) => {
+ let codeLines = code.split("\n").map((line, lineIndex) => {
161
let newLine = line;
162
- exports.forEach((name) => {
+ exports.forEach((name, exportIndex) => {
163
if (line.startsWith(`"${name}"`)) {
164
- newLine = newLine.replace(";", ",");
+ newLine = newLine.replace(
165
+ ";",
166
+ exportIndex === exports.length ? "," : ""
167
+ );
168
169
});
- if (newLine === "}") {
170
+ if (newLine === "}" && lineIndex !== codeLines.length) {
171
newLine = "},";
172
173
return newLine;
0 commit comments