一个 React App 的目录结构可以这样的

    1. config/
    2. webpack.base.config.js
    3. webpack.prod.config.js
    4. webpack.dev.config.js
    5. public/
    6. index.html
    7. scripts/
    8. src/
    9. assets/
    10. components/
    11. pages/
    12. router/
    13. redux/
    14. store.js
    15. reducers/
    16. index.js
    17. style/
    18. utils/
    19. index.js
    20. App.js
    21. package.json

    目录

    • config/ —— 存放配置相关的文件
    • public/ —— 存放 html 相关的文件
    • scripts/ —— 存放脚本相关的文件
    • src/ —— 存放业务文件
      • assets/ —— 存放静态资源
      • components/ —— 存放组件
      • pages/ —— 存放页面
      • router/ —— 存放页面路由
      • redux/ —— 存放 redux 相关数据
        • reducers/ —— 存放各种 reducers
      • style/ —— 存放样式
      • utils/ —— 存放 js 方法

    文件

    • config/webpack.base.config.js —— webpack 公共配置
    • config/webpack.prod.config.js —— webpack 生产环境配置
    • config/webpack.dev.config.js —— webpack 开发环境配置
    • public/index.html —— 页面模板
    • src/store/store.js —— Redux store
    • src/store/reducer/index.js —— Redux reducer
    • src/index.js —— Webpack entry
    • src/App.js —— React entry
    • package.json —— Node 配置

    「@浪里淘沙的小法师」