chore(api): compile TS into /dist (#49812

* chore: compile TS into /dist

Having the output co-located with the source meant that the js would be
imported by default. Given that we don't recompile on source changes,
this means the server got 'stuck' at the point of compilation and would
only register changes on build.

Also, compiling to a dist directory should make it easier to build when
we want to deploy. That said, the motivation is mostly DX.

* fix: put schema.prisma in the default location
This commit is contained in:
Oliver Eyton-Williams
2023-03-28 16:12:20 +02:00
committed by GitHub
parent bf3aa621e9
commit a128dd8fcd
21 changed files with 20 additions and 9 deletions
+4 -3
View File
@@ -50,9 +50,10 @@
"url": "git+https://github.com/freeCodeCamp/freeCodeCamp.git"
},
"scripts": {
"build": "tsc",
"develop": "nodemon server.ts",
"start": "NODE_ENV=production node server.js",
"build": "tsc -p tsconfig.build.json",
"clean": "rm -rf dist",
"develop": "nodemon src/server.ts",
"start": "NODE_ENV=production node dist/server.js",
"test": "jest --force-exit",
"prisma": "MONGOHQ_URL=mongodb://localhost:27017/freecodecamp?directConnection=true prisma",
"postinstall": "prisma generate"