Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
da823e51d5 | |||
b68aa06941 | |||
f5ee2c2c70 | |||
0c018e6448 | |||
565c66e4e6 | |||
72ad77446c | |||
59ce28395f | |||
cddd7ffd25 |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@gitzone/tsbuild",
|
||||
"version": "2.1.52",
|
||||
"version": "2.1.56",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@gitzone/tsbuild",
|
||||
"version": "2.1.52",
|
||||
"version": "2.1.56",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pushrocks/early": "^3.0.6",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitzone/tsbuild",
|
||||
"version": "2.1.52",
|
||||
"version": "2.1.56",
|
||||
"private": false,
|
||||
"description": "TypeScript nightly to easily make use of latest features",
|
||||
"main": "dist_ts/index.js",
|
||||
|
@ -16,17 +16,12 @@ export const compilerOptionsDefault: CompilerOptions = {
|
||||
module: plugins.typescript.ModuleKind.ES2020,
|
||||
target: plugins.typescript.ScriptTarget.ES2020,
|
||||
moduleResolution: plugins.typescript.ModuleResolutionKind.Node12,
|
||||
lib: [],
|
||||
lib: ['lib.dom.d.ts'],
|
||||
noImplicitAny: true,
|
||||
esModuleInterop: true,
|
||||
importsNotUsedAsValues: plugins.typescript.ImportsNotUsedAsValues.Preserve
|
||||
};
|
||||
|
||||
export const compilerOptionsWebDefault: CompilerOptions = {
|
||||
...compilerOptionsDefault,
|
||||
lib: [...compilerOptionsDefault.lib, 'lib.dom.d.ts']
|
||||
};
|
||||
|
||||
/**
|
||||
* merges compilerOptions with the default compiler options
|
||||
*/
|
||||
@ -34,17 +29,9 @@ export const mergeCompilerOptions = (
|
||||
customTsOptions: CompilerOptions,
|
||||
argvArg?: any
|
||||
): CompilerOptions => {
|
||||
const defaultOptionsToMerge = (() => {
|
||||
if (argvArg && argvArg.web) {
|
||||
return compilerOptionsWebDefault;
|
||||
} else {
|
||||
return compilerOptionsDefault;
|
||||
}
|
||||
})();
|
||||
|
||||
// create merged options
|
||||
const mergedOptions: CompilerOptions = {
|
||||
...defaultOptionsToMerge,
|
||||
...compilerOptionsDefault,
|
||||
...customTsOptions,
|
||||
...argvArg && argvArg.skiplibcheck ? {
|
||||
skipLibCheck: true
|
||||
@ -54,10 +41,12 @@ export const mergeCompilerOptions = (
|
||||
} : {},
|
||||
...argvArg && argvArg.commonjs ? {
|
||||
module: plugins.typescript.ModuleKind.CommonJS,
|
||||
moduleResolution: plugins.typescript.ModuleResolutionKind.Classic,
|
||||
moduleResolution: plugins.typescript.ModuleResolutionKind.NodeJs,
|
||||
} : {},
|
||||
};
|
||||
|
||||
console.log(mergedOptions)
|
||||
|
||||
return mergedOptions;
|
||||
};
|
||||
|
||||
|
@ -38,7 +38,7 @@ export const runCli = async () => {
|
||||
},
|
||||
{},
|
||||
process.cwd(),
|
||||
{ web: true }
|
||||
{ web: true, ...argvArg },
|
||||
);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user