Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.4] UI: Fixed generate types and build in Windows OS #6339

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions ui-ngx/.yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
network-timeout 1000000
11 changes: 7 additions & 4 deletions ui-ngx/generate-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
const child_process = require("child_process");
const fs = require('fs');
const path = require('path');
const typeDir = './target/types';
const srcDir = typeDir + '/src';
const moduleMapPath = "src/app/modules/common/modules-map.ts";

const typeDir = path.join('.', 'target', 'types');
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}`);
try {
Expand All @@ -28,7 +31,7 @@ try {
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);
try {
child_process.execSync(cliCommand);
Expand Down