{"id":16005762,"url":"https://github.com/thibaudcolas/react-router-browserify-build","last_synced_at":"2026-04-29T16:35:37.561Z","repository":{"id":146981035,"uuid":"60105046","full_name":"thibaudcolas/react-router-browserify-build","owner":"thibaudcolas","description":"Warning: Browserify and the React ecosystem","archived":false,"fork":false,"pushed_at":"2016-09-11T19:40:53.000Z","size":237,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-31T06:31:53.528Z","etag":null,"topics":["browserify","react","react-router"],"latest_commit_sha":null,"homepage":"https://thib.me/warning-browserify-and-the-react-ecosystem","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/thibaudcolas.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":"2016-05-31T16:16:21.000Z","updated_at":"2023-12-31T01:47:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad6febdb-e979-4b2b-98b9-9f3d26ae1fac","html_url":"https://github.com/thibaudcolas/react-router-browserify-build","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thibaudcolas/react-router-browserify-build","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaudcolas%2Freact-router-browserify-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaudcolas%2Freact-router-browserify-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaudcolas%2Freact-router-browserify-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaudcolas%2Freact-router-browserify-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thibaudcolas","download_url":"https://codeload.github.com/thibaudcolas/react-router-browserify-build/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaudcolas%2Freact-router-browserify-build/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274112525,"owners_count":25224327,"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-09-07T02:00:09.463Z","response_time":67,"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":["browserify","react","react-router"],"created_at":"2024-10-08T11:21:34.569Z","updated_at":"2026-04-29T16:35:37.533Z","avatar_url":"https://github.com/thibaudcolas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"react-router-browserify-build\n=============================\n\n\u003e Highlights an issue when building projects using [react-router V2](https://github.com/reactjs/react-router) with [Browserify](http://browserify.org).\n\n## The issue\n\n(Warning: big file) L248 of https://github.com/thibaudcolas/react-router-browserify-build/blob/master/bundle.js#L248.\n\nWhen using `browserify` to bundle a project that uses `react-router`, the default configuration of browserify transforms causes around 3kb of minified/gzipped warning messages to end up in the production bundles.\n\nThe source of the problem is that by default browserify transforms do not run on packages in `node_modules`. Configuring those to run on the whole bundle is simple, but I believe [this is counter-intuitive to the common \"best practices](https://github.com/babel/babelify#why-arent-files-in-node_modules-being-transformed)\", and people might overlook this.\n\n### Reproduction\n\n```\nnpm run start\n# Or\nNODE_ENV=production browserify index.js -t [ babelify ] -t [ envify ] \u003e bundle.js\n```\n\nhttps://github.com/thibaudcolas/react-router-browserify-build/blob/master/bundle.js#L26\n\n## The fix\n\n### On the command line\n\nUse the `-g` or `--global-transform` flag to run `envify` or `loose-envify` on the whole bundle:\n\n```\nNODE_ENV=production browserify index.js -t [ babelify ] -g [ envify ] \u003e bundle.js\n```\n\n### With the API\n\nUse the `global flag`:\n\n```js\nb.transform(envify, { global: true });\n// Or as configuration:\n{\n    transform: [\n        [\n            envify,\n            { global: true },\n        ],\n    ],\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibaudcolas%2Freact-router-browserify-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthibaudcolas%2Freact-router-browserify-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibaudcolas%2Freact-router-browserify-build/lists"}