Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,47 @@ console.log(HttpStatus.OK); // → 200

2. **Const Enum Definitions Not Removed**: The plugin only inlines const enum values but does not remove the const enum definitions from the output. To eliminate unused const enum declarations, you should rely on tree-shaking tools (like Rollup or Webpack with `mode: 'production'`) to remove the dead code.

3. **Namespace Import/Export Not Supported**: The plugin cannot inline const enums when they are accessed through namespace imports or re-exported through namespace exports.

**Not supported - Namespace import:**

```typescript
// a.ts
export const enum CE_Test {
X = 1,
Y = 2,
}

// b.ts
import * as A from "./a";
const X = A.CE_Test.X; // ❌ Won't be inlined
```

**Not supported - Namespace export/import:**

```typescript
// a.ts
export const enum CE_Test {
X = 1,
Y = 2,
}

// b.ts
export * from "./a";

// c.ts
import { CE_Test } from "./b";
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import statement has incorrect syntax. It should be either import { CE_Test } from "./b" (named import) or import * as A from "./b" (namespace import), but not import { CE_Test } as A from "./b" which is not valid TypeScript syntax.

Copilot uses AI. Check for mistakes.
const X = CE_Test.X; // ❌ Won't be inlined, CE_Test is exported by namespace
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment on line 291 contains a grammatical issue. The phrase "CE_Test is exported by namespace" should be "CE_Test is exported via namespace export" or "CE_Test is accessed through a namespace export" for better clarity and correctness.

Suggested change
const X = CE_Test.X; // ❌ Won't be inlined, CE_Test is exported by namespace
const X = CE_Test.X; // ❌ Won't be inlined, CE_Test is accessed through a namespace export

Copilot uses AI. Check for mistakes.
```

**Workaround**: Use named imports instead:

```typescript
// b.ts
import { CE_Test } from "./a";
const X = CE_Test.X; // ✅ Will be inlined
```

## 🧪 Testing

```bash
Expand Down