-
Notifications
You must be signed in to change notification settings - Fork 0
/
ormconfig.js
33 lines (28 loc) · 920 Bytes
/
ormconfig.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require('source-map-support/register');
if (process.env.NODE_ENV === 'production') {
require('./dist/src/internals/environment/load-environment-variables');
const {
TYPEORM_ORMCONFIG_WITH_MIGRATIONS,
} = require(`./dist/src/internals/databases/typeorm-ormconfig-with-migrations`);
module.exports = [
{
...TYPEORM_ORMCONFIG_WITH_MIGRATIONS[0],
entities: ['dist/src/**/typeorm/*.entity.js'],
},
];
} else if (process.env.NODE_ENV === 'development') {
require('./src/internals/environment/load-environment-variables');
const {
TYPEORM_ORMCONFIG_WITH_MIGRATIONS,
} = require(`./src/internals/databases/typeorm-ormconfig-with-migrations`);
module.exports = [
{
...TYPEORM_ORMCONFIG_WITH_MIGRATIONS[0],
entities: ['src/**/typeorm/*.entity.ts'],
},
];
} else {
throw new Error(
'typeorm-cli:unsupported-environment:' + process.env.NODE_ENV,
);
}