{"id":15800614,"url":"https://github.com/theoomoregbee/rollup-babel-react-browser-lib-starter","last_synced_at":"2025-10-04T19:42:25.948Z","repository":{"id":89634505,"uuid":"139025561","full_name":"theoomoregbee/rollup-babel-react-browser-lib-starter","owner":"theoomoregbee","description":" This is a starter pack for building maintainable browser library with Rollup, babel and react 🚀","archived":false,"fork":false,"pushed_at":"2018-07-16T05:10:49.000Z","size":171,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-26T20:12:23.555Z","etag":null,"topics":["babel","browser","iife","javascript","library","pack","react","rollup","starter"],"latest_commit_sha":null,"homepage":"https://theo4u.github.io/rollup-babel-react-browser-lib-starter","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/theoomoregbee.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-28T13:56:51.000Z","updated_at":"2018-10-02T10:59:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"79cca001-d16b-4a02-8f1a-3144a9f73f93","html_url":"https://github.com/theoomoregbee/rollup-babel-react-browser-lib-starter","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"8b395e12274399be60d08642112decad72b7329d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theoomoregbee/rollup-babel-react-browser-lib-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theoomoregbee%2Frollup-babel-react-browser-lib-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theoomoregbee%2Frollup-babel-react-browser-lib-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theoomoregbee%2Frollup-babel-react-browser-lib-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theoomoregbee%2Frollup-babel-react-browser-lib-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theoomoregbee","download_url":"https://codeload.github.com/theoomoregbee/rollup-babel-react-browser-lib-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theoomoregbee%2Frollup-babel-react-browser-lib-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278366609,"owners_count":25975091,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"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":["babel","browser","iife","javascript","library","pack","react","rollup","starter"],"created_at":"2024-10-05T01:03:51.263Z","updated_at":"2025-10-04T19:42:25.901Z","avatar_url":"https://github.com/theoomoregbee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rollup + Babel + React Browser Lib\nThis is a starter pack for building **maintanable** browser library with \n* [rollup](https://github.com/rollup/rollup) building browser compatible `.js` lib\n* [Babel](https://github.com/babel/babel)\n* [React](https://github.com/facebook/react)\n\n## Use Cases\n* **Image previewer**: Where you can trigger a complex image previewer with a particular class name or selector\n* **Image Editor**: Complex image editor where including the distributed `.js` does the trick, like the libraries created with JQuery\n* **And So On**\n\n## Babel Plugins Supported \nCurrently supports the below babel plugin\n* [async/await](https://www.npmjs.com/package/babel-plugin-transform-async-to-generator)\n* [spread...rest](https://www.npmjs.com/package/babel-plugin-transform-object-rest-spread)\n* You can add more in `.babelrc`\n\n## Styles \n* Supports `scss`\n\n**Note** Make sure to isolate your styles under a particular class name like the `LibraryName` to not conflict with parent caller. If you want to make use of external scss, use `@import` directive like so \n\n```scss\n.libraryName {\n   // external \n  @import '../../node_modules/bootstrap/scss/bootstrap.scss';\n  ... custom styles\n}\n```\n\n### Dev server\n\n```\nnpm run dev\n```\n\nTo run dev server in watch mode. Which builds in `/dist` directory. Open `index.html` in your browser to see it in action\n\n## Build\n\n```\nnpm run build\n```\n\n```html\n...\n  \u003cscript src=\"dist/library.js\"\u003e\u003c/script\u003e\n...\n\n\u003cscript\u003e\n  function success (param){\n    alert('Done with success, check console');\n    console.log(param)\n  }\n\n  new LibraryName('.btn', success);\n\u003c/script\u003e\n```\n\n## Build Config\n\n* Library name can be updated in [rollup.config.js](rollup.config.js), `moduleName` field. Then `new NewName(...args)`\n* Generated library file name can be changed in [package.json](package.json), `browser` field.\n\n## Helpers\n\n* [Cache](/src/cache.js): An in app memory singleton for holding global variables which can be gotten anywhere even in the react app services like so\n\n```js\n// setting a variable to be global\nimport Cache from './helpers/cache'\n...\nCache.set('key', value)\n```\n\n```js\nimport Cache from './helpers/cache'\n...\n// usage \nexport const performAction = () =\u003e {\n  const key = Cache.get('key')\n  console.log('key', key)\n}\n```\n\nCheck [main.js](/src/main.js) for setting and usage in [service.js](src/app/utils/service.js)\n\n\n## Contribution \n\nStick to \n* [standardjs](https://github.com/standard/standard) formatting and linting\n* [conventional commit message](https://conventionalcommits.org/) for commit message patterns\n\n\n## Contributors\n\n* Theophilus Omoregbee \u003ctheo4u@ymail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheoomoregbee%2Frollup-babel-react-browser-lib-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheoomoregbee%2Frollup-babel-react-browser-lib-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheoomoregbee%2Frollup-babel-react-browser-lib-starter/lists"}