{"id":20333082,"url":"https://github.com/jaebradley/example-rollup-react-component-npm-package","last_synced_at":"2025-04-07T17:07:54.892Z","repository":{"id":31866961,"uuid":"129270896","full_name":"jaebradley/example-rollup-react-component-npm-package","owner":"jaebradley","description":"Example React Component, Published to npm","archived":false,"fork":false,"pushed_at":"2023-03-02T03:44:12.000Z","size":12981,"stargazers_count":178,"open_issues_count":1,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-31T16:14:08.257Z","etag":null,"topics":["npm","npm-package","react","rollup","rollup-example"],"latest_commit_sha":null,"homepage":"https://jaebradley.github.io/example-rollup-react-component-npm-package/?selectedKind=AnExample\u0026selectedStory=basic%20usage\u0026full=0\u0026addons=1\u0026stories=1\u0026panelRight=1\u0026addonPanel=storybook%2Factions%2Factions-panel","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/jaebradley.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,"governance":null}},"created_at":"2018-04-12T15:16:03.000Z","updated_at":"2025-01-15T19:50:23.000Z","dependencies_parsed_at":"2023-01-14T20:00:42.946Z","dependency_job_id":"ad1251e7-bbd3-4d09-9389-733f397f1c9e","html_url":"https://github.com/jaebradley/example-rollup-react-component-npm-package","commit_stats":{"total_commits":111,"total_committers":6,"mean_commits":18.5,"dds":0.5495495495495495,"last_synced_commit":"b467e2357bf3dcb84acc1e7360dbe139fef6b886"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fexample-rollup-react-component-npm-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fexample-rollup-react-component-npm-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fexample-rollup-react-component-npm-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fexample-rollup-react-component-npm-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaebradley","download_url":"https://codeload.github.com/jaebradley/example-rollup-react-component-npm-package/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694876,"owners_count":20980733,"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":["npm","npm-package","react","rollup","rollup-example"],"created_at":"2024-11-14T20:29:16.140Z","updated_at":"2025-04-07T17:07:54.874Z","avatar_url":"https://github.com/jaebradley.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# example-rollup-react-component-npm-package\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/jaebradley/example-rollup-react-component-npm-package.svg)](https://greenkeeper.io/)\n![Example Rollup React Component NPM Package](https://github.com/jaebradley/example-rollup-react-component-npm-package/workflows/Example%20Rollup%20React%20Component%20NPM%20Package/badge.svg)\n[![codecov](https://codecov.io/gh/jaebradley/example-rollup-react-component-npm-package/branch/master/graph/badge.svg)](https://codecov.io/gh/jaebradley/example-rollup-react-component-npm-package)\n[![npm](https://img.shields.io/npm/dt/@jaebradley/example-rollup-react-component-npm-package.svg)](https://www.npmjs.com/package/@jaebradley/example-rollup-react-component-npm-package)\n[![npm](https://img.shields.io/npm/v/@jaebradley/example-rollup-react-component-npm-package.svg)](https://www.npmjs.com/package/@jaebradley/example-rollup-react-component-npm-package)\n\nExample `React` component \"library\" using [`rollup`](https://github.com/rollup/rollup) that is published to `npm`.\n\n## `rollup` and `webpack`\n\nThere are a lot of articles that compare `rollup` and `webpack` (like [this](https://medium.com/webpack/webpack-and-rollup-the-same-but-different-a41ad427058c) or [this](https://webpack.js.org/comparison/) or [this](https://stackoverflow.com/a/43255948/5225575) or [this](https://nolanlawson.com/2016/08/15/the-cost-of-small-modules/)).\n\nThe general point is\n\u003e `webpack` is generally a better fit for applications, and `rollup` is generally a better fit for libraries\n\u003csup\u003e[1](#general-footnote)\u003c/sup\u003e\n\n## So what is this project?\n\nI've never used `rollup` before - hell, I've *barely* used `webpack` before.\n\nThis was mostly to see how easy / difficult it was to create a `React` component package using `rollup` (aka \"proof-of-concept\").\n\nMy requirements for this package were\n\n1. Use `babel`\n2. Use `semantic-release`\n3. Use `sass`\n4. Support `umd` and `es` modules\n5. Use `storybook`\n6. Make the exported components really simple\n\n## My general thoughts\n\n* Seemed pretty easy to get started with `rollup`\n  * There are **a lot of plugins** \u003csup\u003e[2](#metric-fuck-ton-footnote)\u003c/sup\u003e\n  * Pretty easy to specify output types (`umd` and `es`, for example)\n  * Some `rollup` plugins didn't really play nicely with `babel@7` - which is why I downgraded to `6` (I could definitely be messing something up)\n* Not an easy way to plug `storybook` in\n  * It's weird and feels kind've gross because `storybook` is using `webpack` to build 😬\n* Articles that were helpful\n  * [`rollup` Guide](https://rollupjs.org/guide/en)\n  * [How I Set Up a React Component Library with Rollup](https://medium.com/tech-grandata-com/how-i-set-up-a-react-component-library-with-rollup-be6ccb700333)\n  * [Publishing Baller React Modules](https://hackernoon.com/publishing-baller-react-modules-2b039d84bce7) \u003csup\u003e[3](#baller-react-modules-footnote)\u003c/sup\u003e\n  * [Making of a Component Library for React](https://hackernoon.com/making-of-a-component-library-for-react-e6421ea4e6c7)\n  * The [`transitive-bullshit/create-react-library`](https://github.com/transitive-bullshit/create-react-library) was also very useful to inspect\n\n## Footnotes\n\n\u003cul\u003e\n  \u003cli\u003e\u003ca name=\"general-footnote\"\u003e\u003csup\u003e1\u003c/sup\u003e\u003c/a\u003egeneral general general general general. In general, I could do this all day.\u003c/li\u003e\n  \u003cli\u003e\u003ca name=\"metric-fuck-ton-footnote\"\u003e\u003csup\u003e2\u003c/sup\u003e\u003c/a\u003e\u003ca href=\"https://github.com/rollup/rollup/wiki/Plugins\"\u003eLike a metric fuck ton of plugins\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca name=\"baller-react-modules-footnote\"\u003e\u003csup\u003e3\u003c/sup\u003e\u003c/a\u003e\u003ca href=\"https://media.giphy.com/media/oOTTyHRHj0HYY/giphy.gif\"\u003eHow I feel about \"baller\"\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaebradley%2Fexample-rollup-react-component-npm-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaebradley%2Fexample-rollup-react-component-npm-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaebradley%2Fexample-rollup-react-component-npm-package/lists"}