fix(build): resolve linter and tsconfig project service errors, guarantee dist/main existence in start-dev
Deploy Canina / deploy (push) Has been cancelled
Deploy Canina / deploy (push) Has been cancelled
This commit is contained in:
1 parent
a291fa0c4a
commit
6362750dea
50 files changed
+12128
-10959
No files matched your search
@@ -1,9 +1,17 @@
|
||||
const { spawn } = require('child_process');
|
||||
const { spawn, execSync } = require('child_process');
|
||||
const http = require('http');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const BACKEND_PORT = 4001;
|
||||
const MAX_WAIT = 60000;
|
||||
|
||||
const distMainPath = path.join(__dirname, '..', 'backend', 'dist', 'main.js');
|
||||
if (!fs.existsSync(distMainPath)) {
|
||||
console.log('[start-dev] Compiling backend dist/main.js before launch...');
|
||||
execSync('npm run build', { cwd: path.join(__dirname, '..', 'backend'), stdio: 'inherit' });
|
||||
}
|
||||
|
||||
function waitForBackend(port, timeout) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const start = Date.now();
|
||||
|
||||
Reference in new issue
Block a user