File tree Expand file tree Collapse file tree 4 files changed +18
-26
lines changed
Expand file tree Collapse file tree 4 files changed +18
-26
lines changed Original file line number Diff line number Diff line change 66 "private" : false ,
77 "author" :
" Vinit Kumar <[email protected] > (http://vinitkumar.me)" ,
88 "scripts" : {
9- "build" : " tsc" ,
9+ "build" : " tsc -p tsconfig.prod.json" ,
10+ "build:dev" : " tsc" ,
1011 "start" : " ts-node server.ts" ,
1112 "start:prod" : " node dist/server.js" ,
1213 "dev" : " nodemon --exec ts-node server.ts" ,
Original file line number Diff line number Diff line change @@ -70,7 +70,13 @@ const connect = async (): Promise<typeof mongoose> => {
7070
7171const modelsPath = __dirname + '/app/models' ;
7272fs . readdirSync ( modelsPath ) . forEach ( ( file ) => {
73- require ( modelsPath + '/' + file ) ;
73+ // Only load .js or .ts files, skip .map and other files
74+ if ( file . endsWith ( '.js' ) || file . endsWith ( '.ts' ) ) {
75+ // Skip .d.ts declaration files
76+ if ( ! file . endsWith ( '.d.ts' ) ) {
77+ require ( modelsPath + '/' + file ) ;
78+ }
79+ }
7480} ) ;
7581
7682passportConfig ( passport , cfg ) ;
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " ./tsconfig.json" ,
3+ "compilerOptions" : {
4+ "sourceMap" : false ,
5+ "declaration" : false ,
6+ "declarationMap" : false
7+ }
8+ }
9+
Original file line number Diff line number Diff line change 55 {
66 "src" : " dist/server.js" ,
77 "use" : " @vercel/node"
8- },
9- {
10- "src" : " public/**" ,
11- "use" : " @vercel/static"
128 }
139 ],
1410 "routes" : [
15- {
16- "src" : " /css/(.*)" ,
17- "dest" : " /public/css/$1"
18- },
19- {
20- "src" : " /js/(.*)" ,
21- "dest" : " /public/js/$1"
22- },
23- {
24- "src" : " /img/(.*)" ,
25- "dest" : " /public/img/$1"
26- },
27- {
28- "src" : " /font/(.*)" ,
29- "dest" : " /public/font/$1"
30- },
31- {
32- "src" : " /webfonts/(.*)" ,
33- "dest" : " /public/webfonts/$1"
34- },
3511 {
3612 "src" : " /(.*)" ,
3713 "dest" : " /dist/server.js"
You can’t perform that action at this time.
0 commit comments