TypeStrong / TypeStrong/ts-loader
transpileOnly : true will make const enum not work
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.5k
- Forks
- 439
- Avg merge
- 17h 17m
- Merged PRs (30d)
- 2
Description
Expected Behaviour
when I use transpileOnly : true , const enum will not work。 I think it is reasonable, but it would be good if had a description in the document
Actual Behaviour
// test.d.ts
declare namespace Test {
export const enum Hello {
Hello = 1
}
}
// index.ts
console.log(Test.Hello.Hello)

Steps to Reproduce the Problem
Location of a Minimal Repository that Demonstrates the Issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the ts-loader documentation for transpileOnly and reviewing how it describes TypeScript features that require type checking. Document that const enum usage does not work as expected with transpileOnly enabled, using the provided test.d.ts and index.ts example as the reference; done when users can find and understand this limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, webpack
- Domain
- build-system, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100