{"id":4521,"url":"https://github.com/mjohnston/react-native-webpack-server","last_synced_at":"2026-01-25T13:31:15.810Z","repository":{"id":30479061,"uuid":"34033128","full_name":"mjohnston/react-native-webpack-server","owner":"mjohnston","description":"Build React Native apps with Webpack","archived":false,"fork":false,"pushed_at":"2016-10-08T12:27:47.000Z","size":405,"stargazers_count":931,"open_issues_count":11,"forks_count":84,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-09-26T04:45:48.477Z","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/mjohnston.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-04-16T03:51:37.000Z","updated_at":"2025-08-19T15:51:42.000Z","dependencies_parsed_at":"2022-07-28T02:09:07.083Z","dependency_job_id":null,"html_url":"https://github.com/mjohnston/react-native-webpack-server","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/mjohnston/react-native-webpack-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjohnston%2Freact-native-webpack-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjohnston%2Freact-native-webpack-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjohnston%2Freact-native-webpack-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjohnston%2Freact-native-webpack-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjohnston","download_url":"https://codeload.github.com/mjohnston/react-native-webpack-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjohnston%2Freact-native-webpack-server/sbom","scorecard":{"id":651671,"data":{"date":"2025-08-11","repo":{"name":"github.com/mjohnston/react-native-webpack-server","commit":"98c5c4c2a809da90bc076c9de73e3acc586ea8df"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: Examples/BabelES6/android/gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T13:39:19.535Z","repository_id":30479061,"created_at":"2025-08-21T13:39:19.535Z","updated_at":"2025-08-21T13:39:19.535Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28753431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T10:25:12.305Z","status":"ssl_error","status_checked_at":"2026-01-25T10:25:11.933Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-01-05T20:17:15.116Z","updated_at":"2026-01-25T13:31:15.795Z","avatar_url":"https://github.com/mjohnston.png","language":"JavaScript","readme":"# react-native-webpack-server\n\nreact-native-webpack-server is a development server that leverages the [Webpack Dev Server](https://github.com/webpack/webpack-dev-server) and the [React Packager](https://github.com/facebook/react-native/tree/master/packager) to enable building React Native JavaScript bundles with webpack. This allows you to use the existing webpack ecosystem when targeting React Native.\n\n[![react-native-webpack channel on slack](https://img.shields.io/badge/discord-%23react--native--webpack%20%40%20reactiflux-61dafb.svg?style=flat-square)](http://www.reactiflux.com)\n[![Build Status](https://travis-ci.org/mjohnston/react-native-webpack-server.svg)](https://travis-ci.org/mjohnston/react-native-webpack-server)\n\n## LOOKING FOR A MAINTAINER\n\nRNWS is not actively maintained; if you'd like to help, leave a comment on [#143](https://github.com/mjohnston/react-native-webpack-server/issues/143)!\n\n## Installing\n\n```shell\nnpm install --save-dev react-native-webpack-server\n```\n\n## Using\n\nUse `--help` for all CLI options:\n\n```shell\nnode_modules/.bin/rnws --help\nnode_modules/.bin/rnws start --help\nnode_modules/.bin/rnws bundle --help\n```\n\n### Setup\n\nBy default React Native will look for **index.ios.js** and **index.android.js** at the root of the project. Delete these files and add entries in your webpack config:\n\n```js\nentry: {\n  'index.ios': ['./src/main.js'],\n  'index.android': ['./src/main.js']\n}\n```\n\nStart react-native-webpack-server using `rnws start`. You might want to put this in your `package.json`:\n\n```js\n\"scripts\": {\n  \"bundle\": \"rnws bundle\",\n  \"start\": \"rnws start\"\n}\n```\n\nThis will start the server on port 8080.\n\nOn iOS, change the URL of your application bundle in `AppDelegate.m`, changing 8081 to 8080:\n\n```objc\njsCodeLocation = [NSURL URLWithString:@\"http://localhost:8080/index.ios.bundle?platform=ios\u0026dev=true\"];\n```\n\nOn Android, start your emulator or connect your device and run `adb reverse tcp:8081 tcp:8080`. This causes the device to connect to RNWS on port 8080 when it tries to download to \u003chttp://localhost:8081/index.android.bundle?platform=android\u003e. Ensure that you also set _Dev Settings_ -\u003e _Debug server host for device_ to \"localhost\":\n\n\u003cimg width=\"400\" alt=\"screenshot 2015-10-27 22 49 42\" src=\"https://cloud.githubusercontent.com/assets/2177366/10778764/62bf9f80-7cff-11e5-8710-c2e9039f0350.png\"\u003e\n\n**Note: No debugger or hot module replacement support is available yet for Android.**\n\nCheckout some of the [Examples](/Examples) to get started.\n\n### Bundling for release\n\nWhen you are ready to ship your app, you will want to generate a minified bundle and package it in the binary. Similar to the [React Native packager](https://facebook.github.io/react-native/docs/running-on-device-ios.html#using-offline-bundle), you can generate an offline JS bundle to use your app without a development server:\n\n```shell\nrnws bundle\n```\n\nFor all options, see:\n\n```shell\nrnws bundle --help\n```\n\nIn your webpack config, you will likely want to enable the `UglifyJsPlugin`. The sample apps are configured to enable minification when `process.env.NODE_ENV` is set to `production`. See the [BabelES6 webpack config](https://github.com/mjohnston/react-native-webpack-server/blob/master/Examples/BabelES6/webpack.config.js#L41) for an example.\n\n## Source Maps\n\nCurrent solutions for building React Native bundles with Webpack lose source maps. This is because the Webpack bundle is first built and then passed off to the React Packager which [constructs the source map by hand](https://github.com/facebook/react-native/blob/master/packager/react-packager/src/Packager/Package.js#L149). This is done for speed, but it also means you can only use transforms that map lines 1 to 1.\n\nReact Native Webpack Server enables source maps by generating the react-native and application bundles separately and then combining their source maps.\n\n## Hot Module Replacement\n\n**Note: HMR currently does not work using React Native \u003e=0.12. See [#103](https://github.com/mjohnston/react-native-webpack-server/issues/103) for a temporary workaround.**\n\nSince this is built on Webpack you can now leverage the growing ecosystem of addons such as React hot module replacement via [react-transform-hmr](https://github.com/gaearon/react-transform-hmr).\n\nTo enable hot reload, make sure you first install [babel-plugin-react-transform](https://github.com/gaearon/babel-plugin-react-transform) and [react-transform-hmr](https://github.com/gaearon/react-transform-hmr), then start the server with `--hot`.\n\nYou'll also need to configure Webpack. See the [Babel+ES6 config](https://github.com/mjohnston/react-native-webpack-server/blob/master/Examples/BabelES6/webpack.config.js) for an example.\n\n**NOTE:** hot reload currently only works with the Chrome web socket executor (hit CMD+D in the simulator). If you regurlarly use this feature, you might want to default to the web socket executor in development:\n\nRCTBridge.m:\n```objc\n- (void)setUp\n{\n  Class executorClass = _executorClass ?: _globalExecutorClass ?: [RCTContextExecutor class];\n#if DEBUG\n  executorClass = NSClassFromString(@\"RCTWebSocketExecutor\");\n#endif\n  ...\n  }\n```\n\n## FAQ\n\n**I can't import 3rd party modules in my project.**\n\nMost react-native 3rd party modules are published to npm in ES6+ since the react-native packager handles transpiling. You may need to whitelist these modules in your webpack config, as the default configuration in the example excludes all of node_modules. See [issue #34](https://github.com/mjohnston/react-native-webpack-server/issues/34).\n\n**I get the red box of death when using hot reload even after fixing the exception.**\n\nYour code is still executing. Dismiss the red box using the `Esc` key.\n\n**Why is hot reload using a no-op setInterval() in my app?**\n\nIt's a terrible hack to jump back onto the React Native runloop when a module is changed. If you have a better idea, please open a PR :)\n\n**Source map generation is really slow on io.js.**\n\nOn a late-2012 Macbook Pro, it takes about 1.5 seconds to generate the source map for react-native on io.js. On stable node (0.12.x) it takes around 200ms. I originally thought this was an issue with [source-map](https://github.com/mozilla/source-map) but in an isolated test with the entirety of react-native I found io.js and node.js (stable) to be about the same. If you have any ideas, please let me know. In the meantime, it's best to use the latest stable version of node.js.\n\n**My `.babelrc` configuration is not working**\n\nThe react-native packager will [cache its babel configuration](https://github.com/facebook/react-native/issues/1924), causing any subsequent changes to `.babelrc` to have no effect. Try using the `--resetCache` option to clear the RN packager cache:\n\n```shell\nrnws start --resetCache\n```\n\nSee also: [#63](https://github.com/mjohnston/react-native-webpack-server/issues/63), [facebook/react-native#1924](https://github.com/facebook/react-native/issues/1924)\n","funding_links":[],"categories":["Components","组件","Libraries"],"sub_categories":["Build \u0026 Development","工具包","工具"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjohnston%2Freact-native-webpack-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjohnston%2Freact-native-webpack-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjohnston%2Freact-native-webpack-server/lists"}