gpt4 book ai didi

reactjs - Chrome 扩展 + create-react-app 实时重新加载

转载 作者:行者123 更新时间:2023-12-03 13:37:10 24 4
gpt4 key购买 nike

关于在使用 create-react-app 实现 Chrome 扩展时如何实现实时重新加载,有什么建议吗?目前,每次发生更改时,我都会yarn run build

最佳答案

我设法使用 create-react-app 做到了这一点:

npm i npm-watch --save-dev

然后在package.json中

{
"name": "react-app",
"version": "0.1.0",
"private": false,
"devDependencies": {
"npm-watch": "^0.1.8",
"react-scripts": "0.9.5",
},
"dependencies": {
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"watch": "npm-watch" //add this to the script
},
"watch": { //add this outside the script
"build": "src/"
}
}

关于reactjs - Chrome 扩展 + create-react-app 实时重新加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46082288/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com