{"id":22976459,"url":"https://github.com/interviewstreet/packagebind","last_synced_at":"2025-08-13T16:31:55.932Z","repository":{"id":34643455,"uuid":"180404317","full_name":"interviewstreet/packagebind","owner":"interviewstreet","description":"Connect packages to your application with HMR and babel config","archived":false,"fork":false,"pushed_at":"2023-01-04T21:43:24.000Z","size":871,"stargazers_count":14,"open_issues_count":14,"forks_count":2,"subscribers_count":76,"default_branch":"master","last_synced_at":"2025-08-09T12:53:44.363Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interviewstreet.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}},"created_at":"2019-04-09T16:06:23.000Z","updated_at":"2024-03-12T08:12:17.000Z","dependencies_parsed_at":"2023-01-15T08:30:53.790Z","dependency_job_id":null,"html_url":"https://github.com/interviewstreet/packagebind","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/interviewstreet/packagebind","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interviewstreet%2Fpackagebind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interviewstreet%2Fpackagebind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interviewstreet%2Fpackagebind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interviewstreet%2Fpackagebind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interviewstreet","download_url":"https://codeload.github.com/interviewstreet/packagebind/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interviewstreet%2Fpackagebind/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269770573,"owners_count":24473307,"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-08-10T02:00:08.965Z","response_time":71,"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-12-15T00:51:17.091Z","updated_at":"2025-08-13T16:31:55.578Z","avatar_url":"https://github.com/interviewstreet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## What is packagebind?\n\nLets say you have built an utility package and published on npm and in your application you are using that utility package. Now some change is required in the utility package. Would you cut a new release just to try if it works in application? Nah.\n\n\"I'll use `npm link`\" you might be thinking but it has mulitple known issues.\n\nAnd so we built `packagebind`.\n\n## How does it work?\n\nThere is an awesome babel plugin called [module-resolver](https://github.com/tleunen/babel-plugin-module-resolver) which lets you change the path of imports in your source-code.\n\nIts used in `babel.config.js` like this\n\n```js\nmodule.exports = {\n  plugins: [\n    [\"module-resolver\", {\n      alias: {\n        \"my-design-kit\": \"../my-design-kit/src\", // local path to package source files,\n      }\n    }]\n  ]\n}\n```\n\nThis in itself is good enough, HMR works but there is a problem. The `my-design-kit` package would probably have its own babel config and its own set of node_modules dependencies. Right now instead of using those things, the package is going to use the application's babel config and node_modules.\n\nThis is how we solve it.\n\nInside `babel.config.js`\n\n```js\nconst packagebind = require('packagebind');\n\nconst babelConfig = {\n  plugins: [\n    [\"module-resolver\", {\n      alias: {\n        \"my-design-kit\": \"../my-design-kit/src\", // local path to package source files\n      }\n    }]\n  ]\n}\n\nmodule.exports = packagebind(babelConfig);\n```\n\n## Dependency\n- babel-plugin-module-resolver (For providing alias)\n- babel7 (Aliasing doesn't work correctly with babel6)\n\n## Making this work with CRA\n- Will add this on readme, meanwhile you can follow this thread.\nhttps://github.com/interviewstreet/packagebind/issues/4#issuecomment-524563118 \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterviewstreet%2Fpackagebind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterviewstreet%2Fpackagebind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterviewstreet%2Fpackagebind/lists"}