{"id":17968584,"url":"https://github.com/lijinke666/react-project-template","last_synced_at":"2025-03-25T10:32:22.387Z","repository":{"id":17112381,"uuid":"81154501","full_name":"lijinke666/react-project-template","owner":"lijinke666","description":"React+Redux+ES6+Webpack4+React-Router4+Babe7 项目模板  By: Dawdler :)","archived":false,"fork":false,"pushed_at":"2022-12-10T15:15:26.000Z","size":6926,"stargazers_count":12,"open_issues_count":20,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-20T01:04:25.282Z","etag":null,"topics":["babel7","cli","dev","nodejs","react","react-router-v4","tempalte","webpack4"],"latest_commit_sha":null,"homepage":"https://github.com/lijinke666/dawdler","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lijinke666.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-07T01:59:26.000Z","updated_at":"2020-12-11T15:39:23.000Z","dependencies_parsed_at":"2022-08-28T22:45:56.523Z","dependency_job_id":null,"html_url":"https://github.com/lijinke666/react-project-template","commit_stats":null,"previous_names":[],"tags_count":10,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lijinke666%2Freact-project-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lijinke666%2Freact-project-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lijinke666%2Freact-project-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lijinke666%2Freact-project-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lijinke666","download_url":"https://codeload.github.com/lijinke666/react-project-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245444276,"owners_count":20616350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babel7","cli","dev","nodejs","react","react-router-v4","tempalte","webpack4"],"created_at":"2024-10-29T14:40:51.963Z","updated_at":"2025-03-25T10:32:21.167Z","avatar_url":"https://github.com/lijinke666.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-project-template\n\n[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)\n\nreact+hooks+ES6+webpack@4.X+babel@7.x 项目模板,支持按需加载 \u003cbr/\u003e\n\n推荐直接使用脚手架生成 [dawdler](https://github.com/lijinke666/dawdler) \u003cbr/\u003e\n\n如需使用 TypeScript, 请使用 `typescript` 分支\n\nHave Fun !\n\n\u003e 文件目录 参考 之前公司架构师 `seth` 大牛\n\n## 本地开发\n\n```\ngit clone https://github.com/lijinke666/react-project-template.git\nnpm install or yarn\nnpm start\n访问(自动打开) http://localhost:8080/\n```\n\n## 基本的 npm scripts\n\n* 开始 `npm start`\n* 启动开发服务器 `npm run dev`\n* 打包 `npm run build`\n* 升级所有包 `npm run upgrade`\n* 代码风格检查 `npm run lint`\n* 测试 `npm run test`\n* 覆盖率 `npm run ci`\n\n## 相关技术栈\n\n* react@16\n* webpack@4\n* babel@7\n* connected-react-router@4\n* react-router-dom@4\n* react-router@4\n* react-redux@5\n* antd@3\n* docker\n\n## 关于 jest\n\u003e 由于使用的babel7 为了保持兼容 安装了一个\n\n```\nyarn add --dev babel-core@7.0.0-0 @babel/core babel-jest\n```\n\n请选择桥接模式(bridge) `babel-core@7.0.0-bridge.0`\n否则 `npm run test`可能出现以下报错\n\n```\n    Requires Babel \"^7.0.0-0\", but was loaded with \"6.26.0\". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention \"@babel/core\" or \"babel-core\" to see what is calling Babel.\n```\n[https://github.com/babel/babel-bridge](https://github.com/babel/babel-bridge)\n\n\n## 网络请求\n\n\u003e 基于 axios 封装\n\n```js\nimport request from \"libs/request\"\n\nrequest.get()\nrequest.post()\nrequest.put()\nrequest.delete()\n```\n\n## 默认高阶组件\n\n\u003e 错误边界\n\n```jsx\nimport ErrorBoundary from \"shared/components/ErrorBoundary\"\n\n@ErrorBoundary\nexport default class App extends React.PureComponent{\n    ...\n}\n```\n\n## 默认组件\n\n\u003e 1200px 包裹容器\n\n```jsx\nimport Container from \"shared/components/Container\";\nexport default class App extends React.PureComponent {\n  render() {\n    return(\u003cContainer\u003exxxx\u003c/Container\u003e);\n  }\n}\n```\n\n## 项目目录\n\n```\n\n├── Dockerfile\n├── LICENSE\n├── README.md\n├── __tests__\n│   ├── __mocks__\n│   │   ├── fileMock.js\n│   │   └── styleMock.js\n│   ├── setup.js\n│   └── tests\n│       ├── __snapshots__\n│       │   └── components.test.js.snap\n│       └── components.test.js\n├── config\n│   ├── development.config.js\n│   ├── http.config.js\n│   ├── index.js\n│   └── production.config.js\n├── deploy\n│   ├── app.conf\n│   └── nginx.conf\n├── dist\n│   ├── css\n│   │   ├── app.a759184c.css\n│   │   └── runtime.99a9ba82.css\n│   ├── images\n│   │   └── logo8501194e.png\n│   ├── index.html\n│   ├── js\n│   │   ├── 5.e1db4215.js\n│   │   ├── app.a759184c.js\n│   │   ├── home.026a90d5.js\n│   │   ├── runtime.99a9ba82.js\n│   │   ├── testPage.8d9b912c.js\n│   │   └── vendors.1fe3c3e5.js\n│   └── vendor.b740a114.js\n├── logo.png\n├── package.json\n├── postcss.config.js\n├── rest-mock\n│   └── dawdler.json\n├── src\n│   ├── Home\n│   │   ├── index.js\n│   │   └── styles.less\n│   ├── app\n│   │   ├── components\n│   │   │   └── NotFound\n│   │   │       ├── index.js\n│   │   │       └── styles.less\n│   │   ├── index.js\n│   │   ├── styles.less\n│   ├── icons.js\n│   ├── index.html\n│   ├── index.js\n│   ├── polyfills.js\n│   ├── shared\n│   │   ├── components\n│   │   │   ├── Container\n│   │   │   │   ├── index.js\n│   │   │   │   └── index.less\n│   │   │   └── ErrorBoundary\n│   │   │       └── index.js\n│   │   ├── libs\n│   │   │   ├── component.js\n│   │   │   ├── history.js\n│   │   │   ├── request.js\n│   │   │   └── routes.js\n│   │   └── styles\n│   │       ├── fonts.less\n│   │       ├── mixin.less\n│   │       └── vars.less\n│   └── style.less\n├── webpack.config.js\n└── yarn.lock\n\n```\n\n## License\n\n[MIT](https://github.com/lijinke666/react-project-template/blob/master/LICENCE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flijinke666%2Freact-project-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flijinke666%2Freact-project-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flijinke666%2Freact-project-template/lists"}