passes the jsxPragma options from preset-typescript to plugin-transform-typescript (#7990)
This commit is contained in:
committed by
Henry Zhu
parent
c558dedd7b
commit
bc757c8b75
@@ -53,3 +53,13 @@ require("@babel/core").transform("code", {
|
||||
presets: ["@babel/preset-typescript"]
|
||||
});
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### `jsxPragma`
|
||||
|
||||
`string`
|
||||
|
||||
Replace the function used when compiling JSX expressions.
|
||||
|
||||
This is so that we know that the import is not a type import, and should not be removed
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
import transformTypeScript from "@babel/plugin-transform-typescript";
|
||||
|
||||
export default declare(api => {
|
||||
export default declare((api, { jsxPragma }) => {
|
||||
api.assertVersion(7);
|
||||
|
||||
return {
|
||||
plugins: [transformTypeScript],
|
||||
plugins: [[transformTypeScript, { jsxPragma }]],
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user