【发布时间】:2021-12-12 12:23:21
【问题描述】:
我正在尝试查看我的 src 文件夹中的更改,该文件夹中会有多个 js 文件。我怎样才能做到这一点?当我运行 dev 脚本时,我从索引文件中获取 console.log,但不是从 world 和 hello 文件中获取。谁能解释我如何才能让所有 console.log 出现?
目录:
folder
├── src
| ├── hello.js
| ├── index.js
| └── world.js
| .gitignore
| package.json
| README.md
package.json:
{
"name": "",
"version": "1.0.0",
"description": "",
"main": "src",
"scripts": {
"dev": "nodemon --watch src"
},
"author": "",
"license": "ISC",
"dependencies": {
"nodemon": "^2.0.14"
}
}
src 中的文件:
// index.js
console.log('index.js')
// world.js
console.log('world.js')
// hello.js
console.log('hello.js')
【问题讨论】: