swc-project / swc-project/website

Error unknown field keepClassnames/keepFnames in swc config

Open
#166 3 comments 0 reactions 0 assignees View on GitHub

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 field keepClassnames, expected one of props, topLevel, keepClassNames, keepFnNames, keepPrivateProps, ie8, safari10, reserved at 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 build at master branch:
    image

  • After running npm run build at fixed-flags-names branch
    image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.