-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have a way to skip typescript's module transform #767
Comments
@Kovensky thanks a lot for this issue. I think the easier would be to NOT override |
huafu
added a commit
to huafu/ts-jest
that referenced
this issue
Sep 27, 2018
huafu
added a commit
to huafu/ts-jest
that referenced
this issue
Sep 27, 2018
huafu
added a commit
to huafu/ts-jest
that referenced
this issue
Sep 27, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue :
ts-jest
currently forces the value of the tsconfig optionmodule
to becommonjs
here; however, this breaks use cases where both typescript and babel are used to transform code when the babel transform expects its input to still be in module form.There seems to be code that appears intended to support this use case, but it's broken by the loop at the end of
readTsConfig
which forcibly overrides everything.This issue affects at least
babel-plugin-emotion
: emotion-js/emotion#687Disabling it would, of course, require that the user runs babel's transform instead, but the only use case for disabling it is when you have to also run babel anyway.
Expected behavior :
ts-jest
to either respect themodule
setting intsconfig
, or to have a way to opt out ofts-jest
's overriding of themodule
option.Debug log:
log file content
# content of ts-jest.log : {"context":{"logLevel":20,"namespace":"config","package":"ts-jest","transformerId":1,"tsconfig":{"input":{"compilerOptions":{"types":["node","facebook-js-sdk","google.analytics"]},"extends":"../src/tsconfig.json","files":["../src/webpack.d.ts","../src/declarations.d.ts"]},"resolved":{"compileOnSave":false,"configFileSpecs":{"excludeSpecs":[...],"filesSpecs":[...],"validatedExcludeSpecs":[...],"wildcardDirectories":{}},"errors":[],"fileNames":[...],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"baseUrl":".../src","configFilePath":".../jest/jest.tsconfig.json","declaration":false,"esModuleInterop":true,"importHelpers":true,"inlineSourceMap":false,"inlineSources":true,"isolatedModules":true,"jsx":1,"lib":["lib.es2015.d.ts","lib.es2016.d.ts","lib.es2017.d.ts","lib.esnext.d.ts","lib.dom.d.ts","lib.dom.iterable.d.ts"],"maxNodeModuleJsDepth":0,"module":1,"moduleResolution":2,"noEmit":false,"noEmitHelpers":true,"noImplicitAny":true,"noImplicitThis":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"$$ts-jest$$","plugins":[{"name":"typescript-styled-plugin"}],"removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"strictNullChecks":true,"target":6,"types":["node","facebook-js-sdk","google.analytics"]},"raw":{"compileOnSave":false,"compilerOptions":{"types":["node","facebook-js-sdk","google.analytics"]},"exclude":[...],"extends":"../src/tsconfig.json","files":[...]},"typeAcquisition":{"enable":false,"exclude":[],"include":[]},"wildcardDirectories":{}}},"version":"23.10.2"},"message":"normalized typescript config","sequence":19,"time":"2018-09-27T05:01:11.287Z"}
(note the
"module":1
; it should be"module":6
ifesnext
was being respected)Minimal repo :
This comment in an affected plugin's issues links to a reproduction repo: emotion-js/emotion#687 (comment)
The text was updated successfully, but these errors were encountered: