loopbackio / loopbackio/loopback-next
npm start build stuff and is too slow
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 5.1k
- Forks
- 1.1k
- Ø Merge
- 2 T. 21 Std.
- Gemergte PRs (30 T.)
- 27
Beschreibung
On a project made with the cli npm start launch the following command:
` "start": "node -r source-map-support/register .",`
This basically clean and build the full project and then start it in a dev mode.
This command can take forever to run. Azure App Service ping app and has a 230 timeout before they shutdown the container. On a small instance, the container will be shutdown before loopback has a chance to start. It's anyway a waste of ressource has Azure run build (in the build process, so no timeout) and then start (in startup script).
I belive npm start should run `"start": "node ./dist/index.js",` instead. A specific command for dev could be introduced such as `"dev": "npm run build && node -r source-map-support/register .",`.
Those are my current scripts:
```
"scripts": {
"build": "npm run clean & npm run copy-files && lb-tsc",
"build:watch": "lb-tsc --watch",
"pretest": "npm run build",
"migrate": "npm run build && node ./dist/migrate",
"openapi-spec": "npm run build && node ./dist/openapi-spec",
"dev": "npm run build && node -r source-map-support/register .",
"start": "node ./dist/index.js",
"clean": "lb-clean dist *.tsbuildinfo .eslintcache",
"copy-files": "mkdir -p dist && cp -r ./backend ./src/data ./dist"
},
```
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit den im Issue gezeigten npm-Skripten des Projekts und untersuche, wie die CLI aus der erstellten dist-Ausgabe startet. Sorge dafür, dass npm start den erstellten Einstiegspunkt ohne erneutes Erstellen startet, behalte einen Entwicklungsbefehl für das Verhalten „Erstellen und Ausführen“ bei und überprüfe, dass beide Befehle ihre vorgesehenen Rollen beibehalten.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- nodejs, typescript
- Bereich
- build-system, developer-experience
- Issue-Typ
- Feature
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100