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 65e963e commit 3691f74
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/babel-preset-typescript/src/index.js
Expand Up @@ -41,13 +41,15 @@ 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`
Expand Down

0 comments on commit 3691f74

Please sign in to comment.