update build process and environment configuration
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
node_modules/
|
||||
.env
|
||||
*.env
|
||||
.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": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"dev": "tsx src/index.ts",
|
||||
"build": "tsc src/index.ts --outDir dist --esModuleInterop",
|
||||
"start": "node dist/index.js"
|
||||
"build": "tsc src/index.ts --outDir build --esModuleInterop",
|
||||
"start": "node build/index.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { config as dotenvConfig } from 'dotenv';
|
||||
|
||||
dotenvConfig();
|
||||
dotenvConfig({
|
||||
path: process.env.NODE_ENV === 'production' ? './.env' : './.dev.env',
|
||||
});
|
||||
|
||||
export const CONFIG: {
|
||||
CLIENT_ID: string;
|
||||
|
||||
Reference in New Issue
Block a user