Skip to content

Commit

Permalink
Handle .mts and .cts files in @babel/preset-typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Oct 11, 2021
1 parent 21eeb8e commit b34b337
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/babel-preset-typescript/src/index.js
Expand Up @@ -41,16 +41,16 @@ export default declare((api, opts) => {
plugins: [[transformTypeScript, pluginOptions(isTSX)]],
},
]
: [
: // Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
[
{
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.ts$/,
test: /\.[mc]?ts$/,
plugins: [[transformTypeScript, pluginOptions(false)]],
},
{ test: /\.mts$/, sourceType: "module" },
{ test: /\.cts$/, sourceType: "script" },
{
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.tsx$/,
plugins: [[transformTypeScript, pluginOptions(true)]],
},
Expand Down

0 comments on commit b34b337

Please sign in to comment.