You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A callback function provided as a value to `Options.appendExtension` or to an
37
+
entry in `Options.replaceExtensions`.
38
+
39
+
##### Parameters
40
+
41
+
| Name | Type | Description |
42
+
| :------ | :------ | :------ |
43
+
|`context`|`Object`| - |
44
+
|`context.capturingGroups`|`string`[]| An array of capturing groups returned by `String.prototype.match()` or an empty array if the matcher string was not a regular expression. |
45
+
|`context.specifier`|`string`| The import/export specifier being evaluated by babel. |
|`appendExtension?`|`string`\|[`Callback`](README.md#callback)<`string`\|`undefined`\>| This string will be appended to all relative import specifiers that do not already have a recognized extension. Also accepts a callback function for advanced use cases. **`Default`** undefined |
68
+
|`recognizedExtensions?`|`string`[]| Members of this array will be considered a "recognized extension". **`Default`** defaultRecognizedExtensions |
69
+
|`replaceExtensions?`|`Record`<`string`, `string`\|[`Callback`](README.md#callback)<`string`\>\>| Map of specifiers to their replacements. Specifiers can be strings or regular expressions (i.e. strings that start with ^ and/or end with $). If a specifier is a regular expression, capturing group notation can be used in the replacement. Replacements can either be a string or a callback function that returns a string. **`Default`**|
70
+
|`silent?`|`boolean`| If true, this plugin will generate no output. **`Default`** false |
71
+
|`verbose?`|`boolean`| If true, this plugin will generate more output than usual. **`Default`** false |
Copy file name to clipboardExpand all lines: package.json
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "babel-plugin-transform-rewrite-imports",
3
-
"version": "1.1.0",
3
+
"version": "1.2.0",
4
4
"description": "Add an extension to import specifiers that do not already have one, replace the extensions of those that do, or even rewrite specifiers entirely.",
0 commit comments