整理了一下 react16.7.0 的 webpack 模板

2019-06-23 12:47:36 +08:00
 qxn

基本上 react 需要方法和依赖的库都引配好了。github 地址: https://github.com/qianxiaoning/demo-react16.7.0 欢迎大家 star 或者 fork 呀~

template-antDesign-sass-react16.7.0

build/ 生成目录
public/ 静态资源目录,create-react-app 会直接把这里的东西起在服务根目录
src/
    assets/ 资源文件夹,如图片
    components/ 组件
        ReactSlotPra 弹窗组件,引用父组件传入的 slot 数据
        ReduxSon redux 的修改
        Son 事件总线的发射
    config/ 参数文件夹
    pages/ 页面文件夹
        Home 1.react 中 input 的写法
             2.react 中组件 slot 的实现方式
        News react 中组件 slot 的实现方式
        Product 嵌套路由的实现
        ParentSonTransmit 1.父子通讯的方式
                          2.事件总线的监听与销毁
        ReduxExperience redux 的引用
        HocPra 使用 hoc 高阶组件的公共方法
        HttpPra 1.axios 请求试验
                2.引入 antd 库
    redux/ redux 文件夹
    router/ router 配置
    structures/ 结构组件
    utils/
        events.js 事件总线模块
        hoc.js hoc 高阶组件(也可以写一些公共的东西,用来替代 mixins )
        http.js http 请求和 antd 的 loading,message 的结合封装
        urls.js 接口地址的统一管理
        utils.js 公共方法,工具函数
    AppNote.js 笔记文件
    index.js 入口文件
    index.scss 公共样式
config-overrides.js customize-cra 对 create-react-app 的 webpack 的可配置,如为了 antd 配置了 babel-plugin-import
jsconfig.json create-react-app 的配置文件,现在只配了项目资源可以绝对路径
package.json proxy 设置的地方
1749 次点击
所在节点    React
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/576602

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX