Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.
/ run Public archive

nodemon 监听文件,并在文件变动后用 esbuild 处理文件

Notifications You must be signed in to change notification settings

Wxh16144/run

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@wuxh/run

nodemon 监听并使用 esbuild 作为 node runtime, 支持 TypeScriptESNext.

Warning

已经弃用! 请使用 tsx 代替此工具 :>

使用

# 处理 CJS 模块 v2.0.0 +
npx @wuxh/run index.ts

# 1.0.1 使用 npx -p @wuxh/run emrun index.ts

# 处理 ESM 模块
npx -p @wuxh/run emrun index.ts

全局安装

npm i @wuxh/run -g

# enrun index.ts  # CJS
# emrun index.ts  # ESM

本地安装

npm i @wuxh/run -D

CJS

{
  "scripts": {
    "start": "enrun index.ts",
  },
  "devDependencies": {
    "@wuxh/run": "*"
  }
}

ESM

{
+ "type": "module", 
  "scripts": {
-   "start": "enrun index.ts",
+   "start": "emrun index.ts",
  }
}
npm start

自定义 nodemon 配置

查看 nodemon 规则

npx -p @wuxh/run enrun index.ts --nodemon='-w ./index.ts'

Warn

  1. v2.0.0 开始:
    1. esnrun 重命名为 enrun
    2. esmrun 重命名为 emrun

About

nodemon 监听文件,并在文件变动后用 esbuild 处理文件

Resources

Stars

Watchers

Forks