Skip to content

Commit 0238dca

Browse files
committed
Add a comment
1 parent f275fdc commit 0238dca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

repo-scripts/size-analysis/analysis-helper.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ export function extractDeclarations(
225225
} else if (ts.isVariableDeclaration(node)) {
226226
declarations.variables.push(node.name!.getText());
227227
} else if (ts.isEnumDeclaration(node)) {
228+
// `const enum`s should not be analyzed. They do not add to bundle size and
229+
// creating a file that imports them causes an error during the rollup step.
228230
if (
231+
// Identifies if this enum had a "const" modifier attached.
229232
!node.modifiers?.some(mod => mod.kind === ts.SyntaxKind.ConstKeyword)
230233
) {
231234
declarations.enums.push(node.name.escapedText.toString());

0 commit comments

Comments
 (0)