{"id":16597204,"url":"https://github.com/adrianmcli/react-build-dist","last_synced_at":"2025-09-15T04:31:01.897Z","repository":{"id":65411585,"uuid":"77361232","full_name":"adrianmcli/react-build-dist","owner":"adrianmcli","description":"A simple utility for compiling your React components to standalone modules.","archived":false,"fork":false,"pushed_at":"2017-03-03T20:29:05.000Z","size":73,"stargazers_count":9,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-03T14:50:53.537Z","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/adrianmcli.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":"2016-12-26T05:53:55.000Z","updated_at":"2023-10-13T19:55:16.000Z","dependencies_parsed_at":"2023-01-23T10:55:00.704Z","dependency_job_id":null,"html_url":"https://github.com/adrianmcli/react-build-dist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Freact-build-dist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Freact-build-dist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Freact-build-dist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Freact-build-dist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrianmcli","download_url":"https://codeload.github.com/adrianmcli/react-build-dist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233077318,"owners_count":18621511,"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":[],"created_at":"2024-10-11T23:55:13.987Z","updated_at":"2025-01-08T18:20:54.721Z","avatar_url":"https://github.com/adrianmcli.png","language":"JavaScript","readme":"# react-build-dist\nA simple utility for compiling your React components to standalone modules.\n\n\u003e Ideally, you should never need to touch Webpack and Babel if all you want to do is to make and publish React components.\n\nThe idea behind this tool is similar to [React-Build-Lib](https://github.com/adrianmcli/react-build-lib), but since this tool deals with Webpack, it still does not work quite well. PRs and suggestions are welcome.\n\n# The Problem\n\nTraditionally, in order to compile React components to standalone modules, you'll need to install and setup Webpack and Babel with the appropriate presets. This is a huge hassle if we want (React component) library authors to focus on creating their wonderful components.\n\nWe want library authors to never need to touch Webpack and Babel if all they want to do is make and share React components.\n\n# The Goal\n\nIdeally, we want the following workflow for React component library authors:\n\n1. Install the package:\n\n  ```bash\n  yarn add --dev react-build-dist\n  ```\n\n2. Add a script to their `package.json` file:\n\n  ```json\n  \"scripts\": {\n    \"build:dist\": \"react-build-dist\"\n  }\n  ```\n3. Now, everytime `npm run build:dist` is run, Webpack will compile the user's React components from the `src` folder into a bundled javascript file inside the `dist` folder (along with a minified version) for standalone usage.\n\n\n## API\n\n### `--bundle-name [filename]`\n\nOutput bundle filename.\n\n```bash\nreact-build-dist --bundle-name MyCoolComponent.js\n```\n\n### `--stage-0`\n\nTurn on stage-0 for experimental features.\n\n```bash\nreact-build-dist --stage-0\n```\n\n### `--package-json [dirPath]`\n\nPath to package.json directory with react-build-dist config override.\n\nWe will try to guess your projects root directory, but depending on your installation configuration\nwe might not be able to reliably find it. This param allows you to manually pass it in.\n\n```bash\nreact-build-dist --package-json $(pwd)\n```\n\n## Config Overrides\n\nIn your `package.json` you can override some of the default build settings. This is useful if your\nproject uses more than just React as an external.\n\nIn your package json add a key of `react-build-dist` and you can override any of the following:\n  - resolveLoader\n  - entry\n  - output\n  - externals\n  - module\n  - plugins\n\nExample:\n\n```json\n  \"react-build-dist\": {\n    \"externals\": {\n      \"react\": \"react\",\n      \"react-dom\": \"react-dom\"\n    }\n  }\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianmcli%2Freact-build-dist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrianmcli%2Freact-build-dist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianmcli%2Freact-build-dist/lists"}