UI: Fixed generate types and build in Windows OS

This commit is contained in:
Vladyslav Prykhodko 2022-03-30 13:31:45 +03:00
parent aacdde9f77
commit 87fed7d235
2 changed files with 8 additions and 4 deletions

1
ui-ngx/.yarnrc Normal file
View File

@ -0,0 +1 @@
network-timeout 1000000

View File

@ -17,9 +17,12 @@
const child_process = require("child_process"); const child_process = require("child_process");
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const typeDir = './target/types';
const srcDir = typeDir + '/src'; const typeDir = path.join('.', 'target', 'types');
const moduleMapPath = "src/app/modules/common/modules-map.ts"; const srcDir = path.join('.', 'target', 'types', 'src');
const moduleMapPath = path.join('src', 'app', 'modules', 'common', 'modules-map.ts');
const ngcPath = path.join('.', 'node_modules', '.bin', 'ngc');
const tsconfigPath = path.join('src', 'tsconfig.app.json');
console.log(`Remove directory: ${typeDir}`); console.log(`Remove directory: ${typeDir}`);
try { try {
@ -28,7 +31,7 @@ try {
console.error(`Remove directory error: ${err}`); console.error(`Remove directory error: ${err}`);
} }
const cliCommand = `./node_modules/.bin/ngc --p src/tsconfig.app.json --declaration --outDir ${srcDir}`; const cliCommand = `${ngcPath} --p ${tsconfigPath} --declaration --outDir ${srcDir}`;
console.log(cliCommand); console.log(cliCommand);
try { try {
child_process.execSync(cliCommand); child_process.execSync(cliCommand);