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 f275fdc commit 0238dcaCopy full SHA for 0238dca
repo-scripts/size-analysis/analysis-helper.ts
@@ -225,7 +225,10 @@ export function extractDeclarations(
225
} else if (ts.isVariableDeclaration(node)) {
226
declarations.variables.push(node.name!.getText());
227
} 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.
230
if (
231
+ // Identifies if this enum had a "const" modifier attached.
232
!node.modifiers?.some(mod => mod.kind === ts.SyntaxKind.ConstKeyword)
233
) {
234
declarations.enums.push(node.name.escapedText.toString());
0 commit comments