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",
|
"name": "@gitzone/tsbuild",
|
||||||
"version": "2.1.52",
|
"version": "2.1.56",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@gitzone/tsbuild",
|
"name": "@gitzone/tsbuild",
|
||||||
"version": "2.1.52",
|
"version": "2.1.56",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/early": "^3.0.6",
|
"@pushrocks/early": "^3.0.6",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsbuild",
|
"name": "@gitzone/tsbuild",
|
||||||
"version": "2.1.52",
|
"version": "2.1.56",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "TypeScript nightly to easily make use of latest features",
|
"description": "TypeScript nightly to easily make use of latest features",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -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
|
||||||
@ -54,10 +41,12 @@ export const mergeCompilerOptions = (
|
|||||||
} : {},
|
} : {},
|
||||||
...argvArg && argvArg.commonjs ? {
|
...argvArg && argvArg.commonjs ? {
|
||||||
module: plugins.typescript.ModuleKind.CommonJS,
|
module: plugins.typescript.ModuleKind.CommonJS,
|
||||||
moduleResolution: plugins.typescript.ModuleResolutionKind.Classic,
|
moduleResolution: plugins.typescript.ModuleResolutionKind.NodeJs,
|
||||||
} : {},
|
} : {},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log(mergedOptions)
|
||||||
|
|
||||||
return mergedOptions;
|
return mergedOptions;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ export const runCli = async () => {
|
|||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
process.cwd(),
|
process.cwd(),
|
||||||
{ web: true }
|
{ web: true, ...argvArg },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user