diff --git a/README.md b/README.md
index 198373bf..3ce33e39 100644
--- a/README.md
+++ b/README.md
@@ -4,10 +4,10 @@
[](https://travis-ci.org/owais/django-webpack-loader)
[](https://coveralls.io/github/owais/django-webpack-loader?branch=master)
-
+
Read http://owaislone.org/blog/webpack-plus-reactjs-and-django/ for a detailed step by step guide on setting up webpack with django using this library.
-
+
Use webpack to generate your static bundles without django's staticfiles or opaque wrappers.
@@ -15,7 +15,6 @@ Use webpack to generate your static bundles without django's staticfiles or opaq
Django webpack loader consumes the output generated by [webpack-bundle-tracker](https://github.com/owais/webpack-bundle-tracker) and lets you use the generated bundles in django.
-
## Compatibility
Test cases cover Django>=1.6 on Python 2.7 and Python>=3.3. 100% code coverage is the target so we can be sure everything works anytime. It should probably work on older version of django as well but the package does not ship any test cases for them.
@@ -29,10 +28,10 @@ npm install --save-dev webpack-bundle-tracker
pip install django-webpack-loader
```
-
+
## Configuration
-
+
### Assumptions
Assuming `BASE_DIR` in settings refers to the root of your django app.
@@ -52,7 +51,6 @@ STATICFILES_DIRS = (
)
```
-
Assuming your webpack config lives at `./webpack.config.js` and looks like this
```javascript
var path = require("path");
@@ -74,7 +72,6 @@ module.exports = {
```
-
### Default Configuration
```python
WEBPACK_LOADER = {
@@ -88,7 +85,6 @@ WEBPACK_LOADER = {
}
```
-
#### CACHE
```python
@@ -100,7 +96,6 @@ WEBPACK_LOADER = {
```
When `CACHE` is set to True, webpack-loader will read the stats file only once and cache the result. This means web workers need to be restarted in order to pick up any changes made to the stats files.
-
#### BUNDLE_DIR_NAME
```python
@@ -119,7 +114,6 @@ If the bundle generates a file called `main-cf4b5fab6e00a404e0c7.js` and your ST
```
-
#### STATS_FILE
```python
@@ -138,12 +132,10 @@ new BundleTracker({filename: './webpack-stats.json'})
and your webpack config is located at `/home/src/webpack.config.js`, then the value of `STATS_FILE` should be `/home/src/webpack-stats.json`
-
#### IGNORE
`IGNORE` is a list of regular expressions. If a file generated by webpack matches one of the expressions, the file will not be included in the template.
-
#### POLL_INTERVAL
@@ -151,11 +143,10 @@ and your webpack config is located at `/home/src/webpack.config.js`, then the va
**NOTE:** Stats file is not polled when in production (DEBUG=False).
-
## Usage
-
+
#### Manually run webpack to build assets.
@@ -199,8 +190,6 @@ INSTALLED_APPS = (
```
-
-
#### Multiple webpack projects
@@ -261,8 +250,6 @@ CKEDITOR.config.contentsCss = '{{ editor_css_files.0.publicPath }}';
```
-
-
## How to use in Production
**It is up to you**. There are a few ways to handle this. I like to have slightly separate configs for production and local. I tell git to ignore my local stats + bundle file but track the ones for production. Before pushing out newer version to production, I generate a new bundle using production config and commit the new stats file and bundle. I store the stats file and bundles in a directory that is added to the `STATICFILES_DIR`. This gives me integration with collectstatic for free. The generated bundles are automatically collected to the target directory and synched to S3.
@@ -292,8 +279,6 @@ if not DEBUG:
})
```
-
-
You can also simply generate the bundles on the server before running collectstatic if that works for you.
@@ -326,7 +311,6 @@ Then in your base jinja template:
```
--------------------
-
Enjoy your webpack with django :)