babel-preset-react-app
Advanced tools
Comparing version
@@ -33,2 +33,7 @@ /** | ||
var isFlowEnabled = validateBoolOption('flow', opts.flow, true); | ||
var isTypeScriptEnabled = validateBoolOption( | ||
'typescript', | ||
opts.typescript, | ||
true | ||
); | ||
var areHelpersEnabled = validateBoolOption('helpers', opts.helpers, true); | ||
@@ -101,2 +106,3 @@ var useAbsoluteRuntime = validateBoolOption( | ||
], | ||
isTypeScriptEnabled && [require('@babel/preset-typescript').default], | ||
].filter(Boolean), | ||
@@ -103,0 +109,0 @@ plugins: [ |
{ | ||
"name": "babel-preset-react-app", | ||
"version": "5.0.4", | ||
"version": "5.0.5-next.9b4009d7", | ||
"description": "Babel preset used by Create React App", | ||
@@ -32,2 +32,3 @@ "repository": "facebook/create-react-app", | ||
"@babel/preset-react": "7.0.0", | ||
"@babel/preset-typescript": "7.1.0", | ||
"@babel/runtime": "7.0.0", | ||
@@ -34,0 +35,0 @@ "babel-loader": "8.0.4", |
@@ -35,17 +35,20 @@ # babel-preset-react-app | ||
## Usage with Flow | ||
Flow is enabled by default. Make sure you have a `.flowconfig` file at the root directory. You can also use the `flow` option on `.babelrc`: | ||
``` | ||
{ | ||
"presets": [["react-app", { "flow": true, "typescript": false }]] | ||
} | ||
``` | ||
## Usage with TypeScript | ||
To use this package with [`@babel/preset-typescript`](https://www.npmjs.com/package/@babel/preset-typescript), you need to disable `@babel/preset-flow` first. | ||
TypeScript is enabled by default. Make sure you have a `tsconfig.json` file at the root directory. You can also use the `typescript` option on `.babelrc`: | ||
You can achieve this by doing: | ||
``` | ||
{ | ||
"presets": [ | ||
["react-app", { | ||
"flow": false | ||
}], | ||
"@babel/typescript" | ||
] | ||
"presets": [["react-app", { "flow": false, "typescript": true }]] | ||
} | ||
``` |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
17932
2.36%362
1.69%54
5.88%18
5.88%2
100%+ Added
+ Added
+ Added
+ Added