{"id":20374156,"url":"https://github.com/mzogheib/react-from-scratch","last_synced_at":"2026-05-28T13:04:32.740Z","repository":{"id":204205644,"uuid":"165476740","full_name":"mzogheib/react-from-scratch","owner":"mzogheib","description":null,"archived":false,"fork":false,"pushed_at":"2019-03-25T21:05:00.000Z","size":187,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-04T20:46:34.262Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/mzogheib.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,"governance":null}},"created_at":"2019-01-13T07:10:13.000Z","updated_at":"2023-10-28T21:35:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"24e79e13-343d-427d-91ee-b4eb1be94c97","html_url":"https://github.com/mzogheib/react-from-scratch","commit_stats":null,"previous_names":["mzogheib/react-from-scratch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mzogheib/react-from-scratch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzogheib%2Freact-from-scratch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzogheib%2Freact-from-scratch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzogheib%2Freact-from-scratch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzogheib%2Freact-from-scratch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mzogheib","download_url":"https://codeload.github.com/mzogheib/react-from-scratch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzogheib%2Freact-from-scratch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33609255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-15T01:22:40.586Z","updated_at":"2026-05-28T13:04:32.724Z","avatar_url":"https://github.com/mzogheib.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Recipe\n\n1. Install Webpack and add scripts to `package.json`\n\n```\nnpm install --save-dev webpack webpack-cli\n```\n\n```\n\"scripts\": {\n  \"start\": \"webpack --mode=development\",\n  \"build\": \"webpack --mode=production\"\n}\n```\n\n2. Install Babel and add `webpack.config.js` with `babel-loader` module\n\n```\nnpm install --save-dev babel-loader @babel/core @babel/preset-env\n```\n\n3. Install React\n\n```\nnpm install --save react react-dom\nnpm install --save-dev @babel/preset-react\n```\n\n4. Install `weback-dev-server`\n\n```\nnpm install --save-dev webpack-dev-server\n```\n\n```\n\"scripts\": {\n  \"start\": \"webpack-dev-server --mode=development --open\",\n  ...\n},\n```\n\n5. Add a scss loader\n\n```\nnpm install sass-loader node-sass --save-dev\nnpm install mini-css-extract-plugin css-loader --save-dev\n```\n\n```\n// Chain the loaders\n{\n  test: /\\.scss$/,\n  use: [\n    MiniCssExtractPlugin.loader,\n    'css-loader',\n    'sass-loader'\n  ]\n},\n// Create a main.css file\nplugins: [\n  new MiniCssExtractPlugin()\n]\n```\n\n6. Install `html-webpack-plugin` and `clean-webpack-plugin` and add to plugins array\n\n7. Install `react-helmet` and set all the `\u003chead\u003e` things in it.\n\n   - Alternatively do it in `index.html` and copy favicons to the `/dist` folder.\n\n8. Support testing with `jest`\n   - `babel-core@^7.0.0-0` needs to be added. See [here](https://stackoverflow.com/questions/50620775/requires-babel-7-0-0-0-but-was-loaded-with-6-26-0).\n   - Add jest config in `package.json` to mock css and transpile js\n\n```\nnpm install --save-dev jest babel-jest babel-core@^7.0.0-0\n```\n\n9. Add `prettier` and `eslint`. Also add auto formatting on git commit using `husky` and `lint-staged`.\n\n```\nnpm install -save-dev prettier eslint eslint-config-prettier eslint-loader eslint-plugin-prettier eslint-plugin-react husky lint-staged babel-eslint\n```\n\n## TODO\n\n- HMR? Or is simple reloading good enough\n- Polyfills\n- Autoprefixing\n\n# Resources\n\nhttps://webpack.js.org/guides/getting-started/\n\nhttps://babeljs.io/docs/en/usage\n\nhttps://github.com/babel/babel-loader\n\nhttps://medium.freecodecamp.org/part-1-react-app-from-scratch-using-webpack-4-562b1d231e75\n\nhttps://www.robinwieruch.de/complete-firebase-authentication-react-tutorial/\n\nhttps://medium.freecodecamp.org/how-to-combine-webpack-4-and-babel-7-to-create-a-fantastic-react-app-845797e036ff\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmzogheib%2Freact-from-scratch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmzogheib%2Freact-from-scratch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmzogheib%2Freact-from-scratch/lists"}