fix(core): update

This commit is contained in:
Philipp Kunz 2022-03-15 20:06:48 +01:00
parent f5ee2c2c70
commit b68aa06941

View File

@ -16,17 +16,12 @@ export const compilerOptionsDefault: CompilerOptions = {
module: plugins.typescript.ModuleKind.ES2020, module: plugins.typescript.ModuleKind.ES2020,
target: plugins.typescript.ScriptTarget.ES2020, target: plugins.typescript.ScriptTarget.ES2020,
moduleResolution: plugins.typescript.ModuleResolutionKind.Node12, moduleResolution: plugins.typescript.ModuleResolutionKind.Node12,
lib: [], lib: ['lib.dom.d.ts'],
noImplicitAny: true, noImplicitAny: true,
esModuleInterop: true, esModuleInterop: true,
importsNotUsedAsValues: plugins.typescript.ImportsNotUsedAsValues.Preserve importsNotUsedAsValues: plugins.typescript.ImportsNotUsedAsValues.Preserve
}; };
export const compilerOptionsWebDefault: CompilerOptions = {
...compilerOptionsDefault,
lib: [...compilerOptionsDefault.lib, 'lib.dom.d.ts']
};
/** /**
* merges compilerOptions with the default compiler options * merges compilerOptions with the default compiler options
*/ */
@ -34,17 +29,9 @@ export const mergeCompilerOptions = (
customTsOptions: CompilerOptions, customTsOptions: CompilerOptions,
argvArg?: any argvArg?: any
): CompilerOptions => { ): CompilerOptions => {
const defaultOptionsToMerge = (() => {
if (argvArg && argvArg.web) {
return compilerOptionsWebDefault;
} else {
return compilerOptionsDefault;
}
})();
// create merged options // create merged options
const mergedOptions: CompilerOptions = { const mergedOptions: CompilerOptions = {
...defaultOptionsToMerge, ...compilerOptionsDefault,
...customTsOptions, ...customTsOptions,
...argvArg && argvArg.skiplibcheck ? { ...argvArg && argvArg.skiplibcheck ? {
skipLibCheck: true skipLibCheck: true