babel / babel/babel-polyfills

Excluding `es.json.stringify` does not work

Open
#180 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
357
Forks
62
PR merge metrics
No merged PRs in 30d

Description

Config:

```json
{
"plugins": [
["polyfill-corejs3", { "method": "usage-pure", "exclude": ["es.json.stringify"] }]
]
}
```

Input:

```js
JSON.stringify({});
```

Expected output:

```js
JSON.stringify({});
```

Actual output:

```js
import _JSON$stringify from "core-js-pure/stable/json/stringify.js";
_JSON$stringify({});
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported polyfill-corejs3 usage-pure configuration with the JSON.stringify input and compare the generated output with the expected unchanged call. Trace how the exclude value "es.json.stringify" is matched during usage-based injection; done means the exclusion prevents the core-js-pure import and replacement.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.