Skip to content

Commit cbf126f

Browse files
committed
chore: prod 환경 구현
1 parent 1dcaf65 commit cbf126f

File tree

3 files changed

+163
-3
lines changed

3 files changed

+163
-3
lines changed

package-lock.json

+157
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"init": "ts-node -r tsconfig-paths/register ./src/init.ts",
88
"start": "ts-node -r tsconfig-paths/register ./src/main.ts",
9-
"build": "tsc",
9+
"start:prod": "NODE_ENV=production node ./dist/main.js",
10+
"build": "tsc && tsc-alias",
1011
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
1112
},
1213
"keywords": [],
@@ -21,6 +22,7 @@
2122
"eslint-plugin-prettier": "^5.0.0",
2223
"eslint-plugin-simple-import-sort": "^12.0.0",
2324
"ts-node": "^10.9.2",
25+
"tsc-alias": "^1.8.10",
2426
"tsconfig-paths": "^4.2.0",
2527
"typescript": "^5.4.5"
2628
},

src/mikro-orm.config.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const config: Options = {
77
dbName: 'data.db',
88
entities: ['dist/**/*.entity.js'],
99
entitiesTs: ['src/**/*.entity.ts'],
10-
metadataProvider: TsMorphMetadataProvider,
1110
extensions: [Migrator],
1211
migrations: {
1312
tableName: 'Migrations',
@@ -23,7 +22,9 @@ const config: Options = {
2322
emit: 'ts',
2423
generator: TSMigrationGenerator,
2524
},
26-
debug: true,
25+
...(process.env.NODE_ENV !== 'production'
26+
? { metadataProvider: TsMorphMetadataProvider, debug: true }
27+
: {}),
2728
};
2829

2930
export default config;

0 commit comments

Comments
 (0)