Unverified Commit 477bdb92 authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

TypeScript preset should always be enabled (#7137)

The preset handles file toggling itself, and actually changes behavior between `.ts` and `.tsx`.
parent 05e52544
...@@ -70,7 +70,8 @@ module.exports = (api: any, options: NextBabelPresetOptions = {}): BabelPreset = ...@@ -70,7 +70,8 @@ module.exports = (api: any, options: NextBabelPresetOptions = {}): BabelPreset =
// @babel/plugin-transform-react-jsx-self automatically in development // @babel/plugin-transform-react-jsx-self automatically in development
development: isDevelopment || isTest, development: isDevelopment || isTest,
...options['preset-react'] ...options['preset-react']
}] }],
require('@babel/preset-typescript')
], ],
plugins: [ plugins: [
require('babel-plugin-react-require'), require('babel-plugin-react-require'),
...@@ -92,14 +93,6 @@ module.exports = (api: any, options: NextBabelPresetOptions = {}): BabelPreset = ...@@ -92,14 +93,6 @@ module.exports = (api: any, options: NextBabelPresetOptions = {}): BabelPreset =
isProduction && [require('babel-plugin-transform-react-remove-prop-types'), { isProduction && [require('babel-plugin-transform-react-remove-prop-types'), {
removeImport: true removeImport: true
}] }]
].filter(Boolean), ].filter(Boolean)
overrides: [
{
test: /\.(tsx|ts)$/,
presets: [
require('@babel/preset-typescript')
]
}
]
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment