{"id":18513228,"url":"https://github.com/yeojz/create-react-app-postcss-starter","last_synced_at":"2026-04-20T03:05:34.452Z","repository":{"id":66303596,"uuid":"87166926","full_name":"yeojz/create-react-app-postcss-starter","owner":"yeojz","description":"Example setup for PostCSS using create-react-app without running eject","archived":false,"fork":false,"pushed_at":"2017-04-04T12:55:25.000Z","size":66,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-14T12:19:20.034Z","etag":null,"topics":["create-react-app","postcss","react","starter"],"latest_commit_sha":null,"homepage":"","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/yeojz.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-04T09:06:41.000Z","updated_at":"2018-01-16T01:10:39.000Z","dependencies_parsed_at":"2023-02-21T02:46:18.419Z","dependency_job_id":null,"html_url":"https://github.com/yeojz/create-react-app-postcss-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yeojz/create-react-app-postcss-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fcreate-react-app-postcss-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fcreate-react-app-postcss-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fcreate-react-app-postcss-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fcreate-react-app-postcss-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeojz","download_url":"https://codeload.github.com/yeojz/create-react-app-postcss-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fcreate-react-app-postcss-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32031070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"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":["create-react-app","postcss","react","starter"],"created_at":"2024-11-06T15:37:01.393Z","updated_at":"2026-04-20T03:05:34.427Z","avatar_url":"https://github.com/yeojz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# create-react-app-postcss-starter\n\nAn example on using [PostCSS](https://github.com/postcss/postcss) with [Create React App](https://github.com/facebookincubator/create-react-app) without ejecting the project.\n\nThis follows the recommendation in the official\nREADME [here](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-a-css-preprocessor-sass-less-etc) with a few modifications.\n\n## Running the App\n\n```\n$\u003e git clone https://github.com/yeojz/create-react-app-postcss-starter.git\n$\u003e yarn install\n$\u003e yarn start\n```\n\nYou'll need to run `yarn start` in order to see `./compiled/style.css` and `./src/style.json`;\n\nUpon `yarn start`, the css is compiled once, before the css watcher and js watcher\nis run. (This is to allow the `./compiled/style.css` to be available first.)\n\nWhen any changes are made, css recompilation will be triggered and subsequently the js\nwatcher will also be triggered after the change to the compiled css has been made.\n\n## Some differences from the create-react-app guide\n\n### Single css entry point\n\nUnlike the `create-react-app` README, only a single file, `./src/style.css` is watched.\n\n### Preprocessed vs non-preprocessed CSS\n\nSince the css watcher only watches `./src/style.css`, if you directly import\na css file, eg: `import 'custom.css'` in any of the js files, that css file _WILL NOT_\nbe compiled via the custom PostCSS processor but would instead be directly handled by `create-react-app`'s default processor.\n\nFor an example, check out `./src/AppCustom.css` in `./src/App.js`\n\n### CSS Modules\n\n[postcss-modules](https://github.com/css-modules/postcss-modules) is included in this example. As such, all files are compiled into\na single `css` file with their class names hashed.\n\nA mapping of classes are written to `./src/style.json` which can then be used within the application, via a normal import. eg:\n\n```js\nimport style from 'src/style'; //.json\n\n\u003cdiv className={style.myClass} /\u003e\n```\n\n## Quick overview of changes\n\nThis is non-exhaustive. Just a quick overview.\n\n-   `postcss.config.js`\n-   replaced `import './index.css'` in `index.js` with `import '../compiled/style.css';`\n-   modified `yarn start` in `package.json`\n-   `style.css` - entry point for css files\n-   `.js` files all modified to take classes from `./src/style.json`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeojz%2Fcreate-react-app-postcss-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeojz%2Fcreate-react-app-postcss-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeojz%2Fcreate-react-app-postcss-starter/lists"}