是否可以让 Bun 将我的 TypeScript 捆绑到保存在 VS Code 中的文件中?
guide说我可以在命令行中调用
bun run index.ts
并将其添加到package.json
像这样,但我不知道如何让它在保存时运行。
{
"name": "quickstart",
"module": "index.ts",
"type": "module",
"scripts": {
"start": "bun run index.ts"
},
"devDependencies": {
"@types/bun": "^1.0.0"
}
}
阅读来源:https://www.sitepoint.com/community/t/running-npm-command-on-file-save/321619
您也许可以使用以下内容:https://www.npmjs.com/package/npm-watch
"watch": {
"start": "{src,test}/*.ts"
},
"scripts": {
"start": "bun run index.ts"
},