Skip to content

Commit

Permalink
exclude mjs to not tranpile
Browse files Browse the repository at this point in the history
  • Loading branch information
F3n67u committed Mar 17, 2022
1 parent 8ecbb31 commit e6f28ae
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/jest-transform/src/ScriptTransformer.ts
Expand Up @@ -759,7 +759,9 @@ class ScriptTransformer {
}
},
{
exts: this._config.moduleFileExtensions.map(ext => `.${ext}`),
exts: this._config.moduleFileExtensions
.filter(ext => ext !== 'mjs')
.map(ext => `.${ext}`),
ignoreNodeModules: false,
matcher: filename => {
if (transforming) {
Expand Down Expand Up @@ -799,6 +801,13 @@ class ScriptTransformer {
shouldTransform(filename: string): boolean {
const ignoreRegexp = this._cache.ignorePatternsRegExp;
const isIgnored = ignoreRegexp ? ignoreRegexp.test(filename) : false;
console.log(
'should transform',
filename,
this._config.transform,
ignoreRegexp,
this._config.transform.length !== 0 && !isIgnored,
);

return this._config.transform.length !== 0 && !isIgnored;
}
Expand Down

0 comments on commit e6f28ae

Please sign in to comment.