Chrome扩展+创建-反应-应用实时重新加载 [英] Chrome Extension + create-react-app live reload

查看:24
本文介绍了Chrome扩展+创建-反应-应用实时重新加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Create-Reaction-app实现Chrome扩展时,有什么建议可以实现实时重载吗?目前我yarn run build每次有更改。

推荐答案

我成功地使用Create-Reaction-App by:

完成了该操作
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/"
    }
}

这篇关于Chrome扩展+创建-反应-应用实时重新加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆