Skip to content

Commit

Permalink
chore(api): remove webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizuo committed Nov 9, 2023
1 parent 4b0b795 commit 4a3252a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 342 deletions.
38 changes: 13 additions & 25 deletions apps/api/ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
const { cpus } = require('os');

const cpuLen = cpus().length;

module.exports = {
apps: [
{
name: 'kz-admin', // 项目名字,启动后的名字
script: './dist/main.js', // 执行的文件
cwd: './', // 根目录
args: '', // 传递给脚本的参数
watch: true, // 开启监听文件变动重启
ignore_watch: ['node_modules', 'public', 'logs'], // 不用监听的文件
instances: '1', // max表示最大的 应用启动实例个数,仅在 cluster 模式有效 默认为 fork
autorestart: true, // 默认为 true, 发生异常的情况下自动重启
max_memory_restart: '1G',
error_file: './logs/app-err.log', // 错误日志文件
out_file: './logs/app-out.log', // 正常日志文件
merge_logs: true, // 设置追加日志而不是新建日志
log_date_format: 'YYYY-MM-DD HH:mm:ss', // 指定日志文件的时间格式
min_uptime: '60s', // 应用运行少于时间被认为是异常启动
max_restarts: 30, // 最大异常重启次数
restart_delay: 60, // 异常重启情况下,延时重启时间
name: 'nest-admin',
script: 'index.js',
autorestart: true,
exec_mode: 'cluster',
watch: false,
instances: cpuLen,
max_memory_restart: '520M',
args: '',
env: {
NODE_ENV: 'development',
},
env_development: {
NODE_ENV: 'development',
},
env_production: {
NODE_ENV: 'production',
},
env_test: {
NODE_ENV: 'test',
PORT: process.env.APP_PORT,
},
},
],
Expand Down
7 changes: 1 addition & 6 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"start": "NODE_ENV=development nest start",
"start:prod": "NODE_ENV=production node dist/main",
"dev": "NODE_ENV=development nest start --watch",
"dev:hmr": "NODE_ENV=development nest build --webpack --webpackPath webpack-hmr.config.js --watch",
"dev:debug": "NODE_ENV=development nest start --debug --watch",
"pm2:prod": "pm2 start ecosystem.config.js --env production",
"pm2:dev": "pm2 start ecosystem.config.js --env development",
Expand Down Expand Up @@ -98,7 +97,6 @@
"@types/node": "^20.9.0",
"@types/supertest": "^2.0.16",
"@types/ua-parser-js": "^0.7.39",
"@types/webpack-env": "^1.18.4",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"eslint": "^8.53.0",
Expand All @@ -110,16 +108,13 @@
"eslint-plugin-unused-imports": "^3.0.0",
"jest": "^29.7.0",
"prettier": "^3.0.3",
"run-script-webpack-plugin": "^0.2.0",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"ts-jest": "^29.1.1",
"ts-loader": "^9.5.0",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.2.2",
"webpack": "^5.89.0",
"webpack-node-externals": "^3.0.0"
"typescript": "^5.2.2"
},
"jest": {
"moduleFileExtensions": [
Expand Down
29 changes: 0 additions & 29 deletions apps/api/webpack-hmr.config.js

This file was deleted.

Loading

0 comments on commit 4a3252a

Please sign in to comment.