Skip to content

A front-end project based on typescript, webpack4, react16, es6, antd, jest and other technologies

Notifications You must be signed in to change notification settings

NewPrototype/webpack4-es6-react-typescript

This branch is 1 commit ahead of master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2d0f503 · Dec 10, 2022

History

35 Commits
Aug 22, 2018
Apr 23, 2019
Sep 16, 2019
Jun 3, 2019
Aug 20, 2018
Aug 22, 2018
Sep 16, 2019
Apr 25, 2019
Jun 4, 2019
Sep 16, 2019
Jan 4, 2019
Jan 4, 2019
Sep 16, 2019
Sep 16, 2019
Dec 10, 2022

Repository files navigation

webpack4-es6-react-typescript

描述:一个基于 webpack4、React16、typescript、react-router-dom、es6、antd、axios 的前端项目,路由支持按需加载或按模块加载,ui框架默认配置是 antd,支持按需加载组件;javascript版本

安装依赖

cnpm install || npm install

启动测试

  • npm run jest 单次运行
  • npm run watch 检测运行
  • npm run reset 快照覆盖

启动项目

  • npm run start 启动项目
  • npm run build 打包

目录结构

.
├── dist  --------------------- 打包文件
├── webpack.config  --------------------- webpack相关配置
├── package.json  --------------------- 项目配置
├── README.md  ------------------------ 说明文件
├── tsconfig.json  ------------------------ typescript配置
├── jest.config.js  ------------------------ jest配置
├── .babelrc  ------------------------ babel 配置
├── __mocks__  ------------------------ 测试辅助文件
├── __tests__  ------------------------ 测试文件
└── src  ------------------------------ 源码目录
    ├── axios  ------------------- 接口
    ├── components  ------------------- 业务模块集合目录
    ├── config  ------------------- 配置参数
    ├── lib  ----------------------- 
        └── img  --------------------- img
        └── less  --------------------- less文件
    └── pages  ------------------------ 页面集合目录
        └── home  --------------------- Home
            ├── Home.js  ------------- 页面入口文件
            └── Home.less  -------- 页面样式
            └── index.js  -------- 页面样式
     ├── router  ------------------- 路由
     ├── store  ------------------- redux
        └── actions  --------------------- actions
        └── reducers  --------------------- reducers
        └── sagas  --------------------- sagas
        └── stores  --------------------- stores
     ├── util  ------------------- 辅助方法
     ├── App  ------------------- 入口组件
     ├── index  ------------------- 入口文件

jest 参数解析

  • --watchAll 开启检测
  • --cache 缓存
  • -b 在第一个失败的测试套件后立即退出测试套件。
  • --debug 打印有关您的Jest配置的调试信息。
  • --errorOnDeprecated 调用已弃用的API会抛出有用的错误消息。有助于简化升级过程。
  • --expand 使用此标志显示完整的差异和错误而不是补丁

TODO

  • typescript热更新
  • antd 按需加载
  • jest 测试环境

友情项目

webpack4-es6-react

webpack4-es6-react-typescript

template-cli

template

electron-web

electron-node

About

A front-end project based on typescript, webpack4, react16, es6, antd, jest and other technologies

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published