@project-tool/plugin-hot-update
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

安装依赖

yarn add react-hot-loader 
yarn add @project-tool/plugin-hot-update

在配置文件中 plugins 属性中添加

{
    ...otherConfigs,
    plugins: [
        ...otherPlugins,
        [
            '@project-tool/plugin-hot-update',
            {
                root: ['./src/']
            }   
        ]
    ]
}

针对需要热更新的组件, 手动添加hot方法

import { hot } from 'react-hot-loader/root';
const App = () => <div>Hello World!</div>;
export default hot(App);

或指定文件,自动添加

{
    ...otherConfigs,
    plugins: [
        ...otherPlugins,
        [
            '@project-tool/plugin-hot-update',
            {
                appKey: string,
                root: string[]
            }   
        ]
    ]
}

Readme

Keywords

none

Package Sidebar

Install

npm i @project-tool/plugin-hot-update

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

54.6 kB

Total Files

32

Last publish

Collaborators

  • xiawenxing
  • hzhuang_wnlo
  • leob_o
  • muzishuiji
  • gaohongyu
  • bytednpm