swc-project / swc-node

Faster ts-node without typecheck
MIT License
1.72k stars 71 forks source link

fix(loader): fix logic when no compilerOptions passed by webpack #661

Closed gyz0072004 closed 2 years ago

gyz0072004 commented 2 years ago

convertCompilerOptionsFromJson function will always produce the options field, so use ?? is not enough.

export function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
    options: CompilerOptions;
    errors: Diagnostic[];
};
export function convertTypeAcquisitionFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
    options: TypeAcquisition;
    errors: Diagnostic[];
};
CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

gyz0072004 commented 2 years ago

@Brooooooklyn would you mind taking a look?