You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Assuming `assets/` is in `settings.STATICFILES_DIRS` like
54
56
55
57
```python
@@ -59,6 +61,7 @@ STATICFILES_DIRS = (
59
61
```
60
62
61
63
<br>
64
+
62
65
Assuming your webpack config lives at `./webpack.config.js` and looks like this
63
66
```javascript
64
67
var path =require("path");
@@ -81,6 +84,7 @@ module.exports = {
81
84
82
85
83
86
<br>
87
+
84
88
### Default Configuration
85
89
```python
86
90
WEBPACK_LOADER= {
@@ -170,12 +174,12 @@ and your webpack config is located at `/home/src/webpack.config.js`, then the va
170
174
## Usage
171
175
<br>
172
176
173
-
#### Manually run webpack to build assets.
177
+
### Manually run webpack to build assets.
174
178
175
179
One of the core principles of django-webpack-loader is to not manage webpack itself in order to give you the flexibility to run webpack the way you want. If you are new to webpack, check one of the [examples](https://github.com/owais/django-webpack-loader/tree/master/examples), read [my detailed blog post](http://owaislone.org/blog/webpack-plus-reactjs-and-django/) or check [webpack docs](http://webpack.github.io/).
176
180
177
181
178
-
#### Settings
182
+
### Settings
179
183
180
184
Add `webpack_loader` to `INSTALLED_APPS`
181
185
@@ -186,7 +190,7 @@ INSTALLED_APPS = (
186
190
)
187
191
```
188
192
189
-
#### Templates
193
+
### Templates
190
194
191
195
```HTML+Django
192
196
{% load render_bundle from webpack_loader %}
@@ -215,7 +219,7 @@ INSTALLED_APPS = (
215
219
<br>
216
220
217
221
218
-
#### Multiple webpack projects
222
+
### Multiple webpack projects
219
223
220
224
Version 2.0 and up of webpack loader also supports multiple webpack configurations. The following configuration defines 2 webpack stats files in settings and uses the `config` argument in the template tags to influence which stats file to load the bundles from.
221
225
@@ -255,7 +259,7 @@ WEBPACK_LOADER = {
255
259
</head>
256
260
```
257
261
258
-
#### File URLs instead of html tags
262
+
### File URLs instead of html tags
259
263
260
264
If you need the URL to an asset without the HTML tags, the `get_files`
261
265
template tag can be used. A common use case is specifying the URL to a
0 commit comments