Skip to content

Commit 206cd73

Browse files
committed
replace local identifiers after collecting all
1 parent 8182dce commit 206cd73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ exports.astNodeVisitor = {
180180
const moduleId = path.relative(path.join(process.cwd(), moduleRoot), rel).replace(/\.js$/, '');
181181
if (getModuleInfo(moduleId, parser)) {
182182
const exportName = importMatch[2] === 'default' ? getDefaultExportName(moduleId, parser) : importMatch[2];
183-
const delimiter = importMatch[2] === 'default' ? '~': getDelimiter(moduleId, exportName, parser);
183+
const delimiter = importMatch[2] === 'default' ? '~' : getDelimiter(moduleId, exportName, parser);
184184
replacement = `module:${moduleId.replace(slashRegEx, '/')}${exportName ? delimiter + exportName : ''}`;
185185
}
186186
}
@@ -196,7 +196,9 @@ exports.astNodeVisitor = {
196196
value: path.basename(currentSourceName)
197197
};
198198
}
199+
});
199200

201+
node.comments.forEach(comment => {
200202
// Replace local types with the full `module:` path
201203
Object.keys(identifiers).forEach(key => {
202204
const regex = new RegExp(`@(event |fires |.*[\{<\|,] ?!?)${key}`, 'g');

0 commit comments

Comments
 (0)