Skip to content

Commit d3c2e2c

Browse files
committed
doc: update README.md
1 parent 2c5a8d8 commit d3c2e2c

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,25 @@ Via `.babelrc` or `babel-loader`.
2929
"@uiw/babel-plugin-add-import-extension", {
3030
// Add .js extension to all imports and exports
3131
"extension": "js",
32-
// Control with a boolean value, default to not processing files that already have an extension
33-
"skipExistingExtensions": true,
32+
// By default, if a declaration file already has an extension, it is preserved. Extensions are added to declaration files that do not have one.
33+
"replace": true,
34+
// If set to `true` and a declaration file has an extension that is *not* included in the `observedScriptExtensions` list, the file will be skipped.
35+
"skipUnlistedExtensions": true,
36+
// Declaration files with extensions present in this list are considered for extension replacement (based on the `replace` option).
37+
// Files with extensions *not* in this list will have the `extension` option's value appended to them.
38+
"observedScriptExtensions": ["js", "ts", "jsx", "tsx", "mjs", "cjs"]
39+
}
40+
]
41+
]
42+
}
43+
```
44+
45+
```json
46+
{
47+
"plugins": [
48+
[
49+
"@uiw/babel-plugin-add-import-extension", {
50+
"extension": "js"
3451
}
3552
]
3653
]

0 commit comments

Comments
 (0)