fix(core): update
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
export * from './tsbuild.exports';
|
||||
|
||||
import './tsbuild.cli';
|
||||
import './tsbuild.cli';
|
||||
|
@ -28,7 +28,10 @@ export const compilerOptionsWebDefault: CompilerOptions = {
|
||||
/**
|
||||
* merges compilerOptions with the default compiler options
|
||||
*/
|
||||
export const mergeCompilerOptions = (customTsOptions: CompilerOptions, argvArg?: any): CompilerOptions => {
|
||||
export const mergeCompilerOptions = (
|
||||
customTsOptions: CompilerOptions,
|
||||
argvArg?: any
|
||||
): CompilerOptions => {
|
||||
const defaultOptionsToMerge = (() => {
|
||||
if (argvArg && argvArg.web) {
|
||||
return compilerOptionsWebDefault;
|
||||
@ -52,7 +55,7 @@ export const mergeCompilerOptions = (customTsOptions: CompilerOptions, argvArg?:
|
||||
export const compiler = (
|
||||
fileNames: string[],
|
||||
options: plugins.typescript.CompilerOptions,
|
||||
argvArg?: any,
|
||||
argvArg?: any
|
||||
): Promise<any[]> => {
|
||||
console.log(`Compiling ${fileNames.length} files...`);
|
||||
let done = plugins.smartpromise.defer<any[]>();
|
||||
|
@ -25,16 +25,11 @@ tsbuildCli.standardTask().subscribe(argvArg => {
|
||||
tsbuildCli.addCommand('custom').subscribe(argvArg => {
|
||||
const listedDirectories = argvArg._;
|
||||
listedDirectories.shift();
|
||||
const compilationCommandObject: {[key: string]: string} = {};
|
||||
const compilationCommandObject: { [key: string]: string } = {};
|
||||
for (const directory of listedDirectories) {
|
||||
compilationCommandObject[`./${directory}/**/*.ts`] = `./dist_${directory}`;
|
||||
};
|
||||
tsbuild.compileGlobStringObject(
|
||||
compilationCommandObject,
|
||||
{},
|
||||
process.cwd(),
|
||||
argvArg
|
||||
);
|
||||
}
|
||||
tsbuild.compileGlobStringObject(compilationCommandObject, {}, process.cwd(), argvArg);
|
||||
});
|
||||
|
||||
tsbuildCli.startParse();
|
||||
|
@ -9,7 +9,7 @@ export * from './tsbuild.classes.compiler';
|
||||
export let compileFileArray = (
|
||||
fileStringArrayArg: string[],
|
||||
compilerOptionsArg: CompilerOptions = {},
|
||||
argvArg?: any,
|
||||
argvArg?: any
|
||||
): Promise<any[]> => {
|
||||
return compiler(fileStringArrayArg, mergeCompilerOptions(compilerOptionsArg, argvArg), argvArg);
|
||||
};
|
||||
@ -25,11 +25,11 @@ export let compileGlobStringObject = async (
|
||||
globStringObjectArg: any,
|
||||
tsOptionsArg: CompilerOptions = {},
|
||||
cwdArg: string = process.cwd(),
|
||||
argvArg?: any,
|
||||
argvArg?: any
|
||||
) => {
|
||||
let compiledFiles = [];
|
||||
for (const keyArg in globStringObjectArg) {
|
||||
if(globStringObjectArg[keyArg]) {
|
||||
if (globStringObjectArg[keyArg]) {
|
||||
console.log(
|
||||
`TypeScript assignment: transpile from ${keyArg} to ${globStringObjectArg[keyArg]}`
|
||||
);
|
||||
|
Reference in New Issue
Block a user