Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/babel-preset-react-app/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,13 @@ module.exports = function(api, opts, env) {
// Strip flow types before any other transform, emulating the behavior
// order as-if the browser supported all of the succeeding features
// https://github.com/facebook/create-react-app/pull/5182
isFlowEnabled &&
// We will conditionally enable this plugin below in overrides as it clashes with
// @babel/plugin-proposal-decorators when using TypeScript.
// https://github.com/facebook/create-react-app/issues/5741
isFlowEnabled && [
require('@babel/plugin-transform-flow-strip-types').default,
false,
],
// Experimental macros support. Will be documented after it's had some time
// in the wild.
require('babel-plugin-macros'),
Expand Down Expand Up @@ -172,6 +177,10 @@ module.exports = function(api, opts, env) {
require('babel-plugin-dynamic-import-node'),
].filter(Boolean),
overrides: [
isFlowEnabled && {
test: /\.(js|mjs|jsx)$/,
Comment thread
ianschmitz marked this conversation as resolved.
Outdated
plugins: [require('@babel/plugin-transform-flow-strip-types').default],
},
isTypeScriptEnabled && {
test: /\.tsx?$/,
plugins: [
Expand Down