当我运行React Server时,它仅监视src / file.ts文件的更改并反映react组件中的那些更改,但是如果我的文件位于src
以外的其他文件夹中,则不会更改时重新加载。
我该如何实现?这是我的电子,打字稿和反应设置。
package.json
包含:
"scripts": {
"react-start": "react-scripts start",
"react-build": "react-scripts build",
"react-test": "react-scripts test --env=jsdom",
"react-eject": "react-scripts eject",
"electron-build": "npm run prebuild && electron-builder",
"release": "npm react-build && electron-builder --publish=always",
"build": "npm run prebuild && npm react-build && npm electron-build",
"prebuild": "tsc ./src/electron.ts --outDir ./public",
"start": "npm run prebuild && concurrently \"cross-env BROWSER=none npm run react-start\" \"wait-on http://localhost:3000 && electron .\""
每次src/electron.ts
文件更改时,Typescript编译器都会运行,并将electro.js文件放入公用文件夹中。但是,在electronic.ts文件更新时,react-scripts不会重新加载组件和环境。这该怎么做 ?