swc-project / swc-project/website
Error unknown field keepClassnames/keepFnames in swc config
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 111
- Forks
- 150
- PR merge metrics
- No merged PRs in 30d
Description
Steps to reproduce
Create swc config file and set keepClassnames and keepFnames of mangle options as described in documentation.
Results
Expected
Flags should be applied, no errors in terminal
Actual
Flags are not applied error in the console
Module build failed (from ./node_modules/swc-loader/src/index.js):
Error: unknown fieldkeepClassnames, expected one ofprops,topLevel,keepClassNames,keepFnNames,keepPrivateProps,ie8,safari10,reservedat line 1 column 750
Update 1
Repository with min code needed to reproduce
https://github.com/kaczor6418/swc-flags-typo
Results:
-
After running
npm run buildat master branch:

-
After running
npm run buildat fixed-flags-names branch

Contributor guide
No contributing guide indexed for this repository
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 in the SWC website documentation and compare the documented mangle option names with the accepted names shown in the error. Use the linked minimal repository and run npm run build to verify the corrected documentation configuration no longer produces the unknown-field error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100