UNPKG

810 Bapplication/x-shView Raw
1#!/usr/bin/env bash
2
3if [ -d "./node_modules/@bxjs/base" ]; then
4 # 在正式应用项目中
5 source ./node_modules/@bxjs/base/cmd.sh
6else
7 echo "只允许在应用工程代码中执行本地调试脚本"
8 exit
9fi
10
11# 本地开发调试app工程
12cmd_stop
13if [ "$1" == "x" ]; then
14 exit 0;
15fi
16# 删除应用app目录下的所有js文件必须强制使用ts强类型编程
17find ./app -name '*.js' -type f -print -exec rm -rf {} \;
18rm -rf .tscache
19# 动态生成应用层的入口避免ts-node不支持node_modules中的文件加载执行问题
20echo "import '@bxjs/base/framework/test'" > ./test.ts
21./node_modules/nodemon/bin/nodemon.js --exec "./node_modules/ts-node/dist/bin.js --cache-directory .tscache --project ./tsconfig.json" ./test.ts $1 --ignore dist/ --ignore test/ --ignore resources/ &