Skip to content

Commit b38696d

Browse files
committed
Clarify installation instructions
The previous instructions may have come across that the only way to use Redux with npm was with a module bundler, like Browserify or Webpack. This reorganizes the text in an effort to more explicitly explain that it's only the extensions require a CJS module bundler.
1 parent 891a97c commit b38696d

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

README.md

+26-4
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,38 @@ To install the stable version:
4545
npm install --save redux
4646
```
4747

48-
Most likely, you’ll also need [the React bindings](https://github.com/rackt/react-redux) and [the developer tools](https://github.com/gaearon/redux-devtools).
48+
This requires using the [npm](https://www.npmjs.com/) package manager. It includes a [UMD](https://github.com/umdjs/umd) build, which is compatible with many popular JavaScript module loaders and environments.
49+
50+
#### Other Installation Methods
51+
52+
We **strongly** recommend using npm over these other options, as most of the [libraries complementary to Redux](#complementary-libraries) are only available on [npm](https://www.npmjs.com/).
53+
54+
However, if you don’t yet use [npm](https://www.npmjs.com/) or a modern module bundler, you have a few options.
55+
56+
##### Bower
57+
58+
If you're using Bower, this command will install the stable version of Redux:
59+
60+
```
61+
bower install redux=https://npmcdn.com/redux/dist/redux.js
62+
```
63+
64+
##### CDNs
65+
66+
Redux is available via [cdnjs](https://cdnjs.com/libraries/redux) and [npmcdn](https://npmcdn.com/redux/dist/redux.min.js). The files on these CDNs are UMD builds, which means that they will export a browser global, `window.redux`, if you're not using a tool like Webpack, Browserify, or RequireJS to build your library.
67+
68+
An example of using the global Redux object can be seen in [the vanilla counter example](https://github.com/rackt/redux/blob/765a3a5742a591adba7ae8b61e0516c49ca594bd/examples/counter-vanilla/index.html).
69+
70+
#### Complementary Libraries
71+
72+
Most likely, you’ll also need [the React bindings](https://github.com/rackt/react-redux) and [the developer tools](https://github.com/gaearon/redux-devtools) while working with Redux.
4973

5074
```
5175
npm install --save react-redux
5276
npm install --save-dev redux-devtools
5377
```
5478

55-
This assumes that you’re using [npm](https://www.npmjs.com/) package manager with a module bundler like [Webpack](http://webpack.github.io) or [Browserify](http://browserify.org/) to consume [CommonJS modules](http://webpack.github.io/docs/commonjs.html).
56-
57-
If you don’t yet use [npm](https://www.npmjs.com/) or a modern module bundler, and would rather prefer a single-file [UMD](https://github.com/umdjs/umd) build that makes `Redux` available as a global object, you can grab a pre-built version from [cdnjs](https://cdnjs.com/libraries/redux). We *don’t* recommend this approach for any serious application, as most of the libraries complementary to Redux are only available on [npm](https://www.npmjs.com/).
79+
Use of the extensions requires that you’re using [npm](https://www.npmjs.com/) in conjunction with a module bundler like [Webpack](http://webpack.github.io) or [Browserify](http://browserify.org/) to consume [CommonJS modules](http://webpack.github.io/docs/commonjs.html).
5880

5981
### The Gist
6082

0 commit comments

Comments
 (0)