{"id":23439814,"url":"https://github.com/baohaoyu/react-ts-app","last_synced_at":"2026-04-22T16:34:14.909Z","repository":{"id":39545420,"uuid":"186136365","full_name":"BaoHaoYu/react-ts-app","owner":"BaoHaoYu","description":"react16.x + redux + react-router + webpack4.x+ + immutable + sass + typescript3.x","archived":false,"fork":false,"pushed_at":"2022-12-10T17:22:06.000Z","size":4700,"stargazers_count":0,"open_issues_count":20,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-06T13:44:29.942Z","etag":null,"topics":["immutablejs","react-applications","react-router-v5","redux","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaoHaoYu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-11T13:29:49.000Z","updated_at":"2020-08-01T03:12:17.000Z","dependencies_parsed_at":"2023-01-26T06:46:08.245Z","dependency_job_id":null,"html_url":"https://github.com/BaoHaoYu/react-ts-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BaoHaoYu/react-ts-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaoHaoYu%2Freact-ts-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaoHaoYu%2Freact-ts-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaoHaoYu%2Freact-ts-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaoHaoYu%2Freact-ts-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaoHaoYu","download_url":"https://codeload.github.com/BaoHaoYu/react-ts-app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaoHaoYu%2Freact-ts-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32145830,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T15:33:03.595Z","status":"ssl_error","status_checked_at":"2026-04-22T15:30:42.712Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["immutablejs","react-applications","react-router-v5","redux","typescript"],"created_at":"2024-12-23T15:36:19.053Z","updated_at":"2026-04-22T16:34:10.399Z","avatar_url":"https://github.com/BaoHaoYu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[中文版](./README_CN.md)\n\n`react@16.8.6` + `redux@4.0.0` + `react-router@5.0.1` + `immutable@3.8.1` + +`webpack@4.20.2` + `typescript@3.0.3` + `sass` \n\n\u003c!-- toc --\u003e\n- [Development Environment](#Development-Environment)\n- [Feature](#Feature)\n- [Running the project for the first time](#Running-the-project-for-the-first-time)\n- [Debugging](#Debugging)\n- [Development](#Development)\n- [Directory Description](#Directory-Description)\n- [Modify css-loader](#Modify-css-loader)\n- [Other suggestion](#Other-suggestion)\n\u003c!-- tocstop --\u003e\n\n## Development Environment\n- Operating system: window 10\n- nodejs: 10.15.0\n- npm: 6.9.0\n- yarn: 1.9.2\n- Development Tools: JetBrains WebStorm 2019.1.1 x64\n- Browser: chrome 74.0.3729.131 stable\n\n## Feature\n- immutablejs\n- sass\n- redux\n- react-router\n- code split\n- hot load\n- no cache\n- stylelint\n- tslint\n- husky\n- lint-staged\n\n## Running the project for the first time\nExecute `yarn` in the project root directory\n\n## Debugging\n- `npm run devSprites`: Execute the packaged Sprite map, which runs every time you add a new image.\n- `npm run devSrc`: Execute and compile index.html, do not have to run multiple times, test entity files only\n- `npm run devServer`: Start webpack-dev-server, then open http://localhost:19080  \n![](__resource__/3.png)\n\n## Development\n- `npm run sprites`: a sprite map of the production environment, a sprite file of the sprite, and a hash of the image file\n- `npm run src`: package js of production environment, js files are hashed. Effect:\n![](__resource__/1.png)\n![](__resource__/2.png)\n\n## Directory Description\n- `config-ts/index.ts`: configuration of main webpack and gulp\n- `config-ts/tsconfig-commom.json`: generic ts configuration\n\n- `webpack-ts/webpack.server.config.ts`: Start the webpack-dev-server configuration file\n- `webpack-ts/webpack.src.config.ts`: compile the actual file, separate development environment compilation and production environment compilation\n\n- `webpack-ts/plugins/deleteFiles.ts`: empty files in a directory\n- `webpack-ts/plugins/insterDataToHtml`: Insert the js generated by the webpack into the html file and insert the url of the sprite into the html file.\n\n## Modify css-loader\nThis is to make it easy to locate the css file for editing in the browser.\nGo to node_modules/css-loader/dist/index.js  \nComment out the following code  \n```javascript\nconst moduleCode = `// Module\\nexports.push([module.id, ${cssAsString}, \"\"${result.map ? `,${result.map}` : ''}]);\\n\\n `;\n```\n\nAdd the following code to the corresponding  \n```javascript\nlet map = null\nif (result.map) {\n  map = result.map.toJSON()\n  map.sources = map.sources.map((src) =\u003e 'file:///' + src.replace(/\\\\/g,'/'))\n}\nconst moduleCode = `// Module\\nexports.push([module.id, ${cssAsString}, \"\"${result.map ? `,${JSON.stringify(map)}` : ''}]);\\n\\n`;\n```\n\nModify the location css by chrome, then modify the file, this modification will be saved locally  \n![](__resource__/sass.gif)\n\n## Other suggestion\n1.css use BEM specification, see https://seesparkbox.com/foundry/bem_by_example","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaohaoyu%2Freact-ts-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaohaoyu%2Freact-ts-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaohaoyu%2Freact-ts-app/lists"}