fix(core): update
This commit is contained in:
parent
f5ee2c2c70
commit
b68aa06941
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user