swc-project / swc-node

Faster ts-node without typecheck
MIT License
1.78k stars 75 forks source link

fix(core): respect useDefineForClassFields tsconfig value #740

Closed dsyddall closed 10 months ago

dsyddall commented 10 months ago

Fixes #739

Currently, useDefineForClassFields is not read from tsconfig.json and not set in the SWC config.

This PR updates the tsCompilerOptionsToSwcConfig function to read the value of useDefineForClassFields from tsconfig.json (using the default value based on target as specified at https://www.typescriptlang.org/tsconfig#useDefineForClassFields)

See: https://swc.rs/docs/configuration/compilation#jsctransformusedefineforclassfields

CLAassistant commented 10 months ago

CLA assistant check
All committers have signed the CLA.