update build process and environment configuration
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
.env
|
.env
|
||||||
|
*.env
|
||||||
.discord-token.json
|
.discord-token.json
|
||||||
|
build/
|
||||||
|
|||||||
12
ecosystem.config.js
Normal file
12
ecosystem.config.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
module.exports = {
|
||||||
|
apps: [
|
||||||
|
{
|
||||||
|
name: 'IotDis',
|
||||||
|
script: './build/index.js',
|
||||||
|
env: {
|
||||||
|
NODE_ENV: 'production',
|
||||||
|
},
|
||||||
|
watch: ['./build', './ecosystem.config.js', './.env'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"dev": "tsx src/index.ts",
|
"dev": "tsx src/index.ts",
|
||||||
"build": "tsc src/index.ts --outDir dist --esModuleInterop",
|
"build": "tsc src/index.ts --outDir build --esModuleInterop",
|
||||||
"start": "node dist/index.js"
|
"start": "node build/index.js"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { config as dotenvConfig } from 'dotenv';
|
import { config as dotenvConfig } from 'dotenv';
|
||||||
|
|
||||||
dotenvConfig();
|
dotenvConfig({
|
||||||
|
path: process.env.NODE_ENV === 'production' ? './.env' : './.dev.env',
|
||||||
|
});
|
||||||
|
|
||||||
export const CONFIG: {
|
export const CONFIG: {
|
||||||
CLIENT_ID: string;
|
CLIENT_ID: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user