【问题标题】:nodemon not watching for changes in tsx filesnodemon 不监视 tsx 文件中的更改
【发布时间】:2018-06-03 15:27:29
【问题描述】:

我正在尝试测试我的 typescript react 应用程序,并且我让 nodemon 对 .ts 文件运行 jasmine 测试,但我无法让 .tsx 触发监视操作。

我的 package.json 有一个相当简单的

"test": "cross-env NODE_ENV=test jasmine-ts **/*.spec.ts*",
"test-watch": "nodemon -e ts -w ./ -x npm run test",

我认为spec.ts* 末尾的* 会告诉nodemon 在.ts.tsx 上重新运行,但这似乎不起作用。

.tsx?也没有

【问题讨论】:

  • -e 参数告诉 nodemon 监视 ts 文件,根目录上的 -w,然后运行 ​​npm run test 脚本。似乎 nodemon 仅在 ts 文件更改时才触发脚本。你不应该在-e 之后添加通配符吗?
  • 感谢@KevinAmiranoff,我试过了,我以为 -e 正在运行我的打字稿编译器。如果您是这样想的,它不适用于 -e ts*

标签: nodemon


【解决方案1】:

原来为 nodemon 写这个的正确方法是 "test-watch": "nodemon -e ts,tsx -w ./ -x npm run test",

【讨论】:

    猜你喜欢
    • 2015-11-14
    • 2015-01-24
    • 2019-12-24
    • 1970-01-01
    • 2021-12-12
    • 2018-07-11
    • 2019-02-20
    • 2017-03-08
    • 1970-01-01
    相关资源
    最近更新 更多