Skip to content

Commit 1762507

Browse files
authored
Update examples to use webpack-bundle-tracker@1.0.0 (django-webpack#271)
* Update examples to use webpack-bundle-tracker@1.0.0 * Update readme with migration instructions
1 parent 0e519d1 commit 1762507

File tree

8 files changed

+15
-7
lines changed

8 files changed

+15
-7
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ examples/**/ve/
7171
examples/**/venv/
7272
examples/**/node_modules/
7373
examples/**/assets/bundles/
74-
examples/**/assets/webpack-stats.json
74+
examples/**/webpack-stats.json
7575

7676
tests/ve/
7777
tests/ve3/

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ pip install django-webpack-loader
3333

3434
<br>
3535

36+
## Migrating from version < 1.0.0
37+
38+
In order to use `django-webpack-loader>=1.0.0`, you must ensure that `webpack-bundle-tracker@1.0.0` is being used on the JavaScript side. It's recommended that you always keep at least minor version parity across both packages, for full compatibility.
39+
40+
This is necessary because the formatting of `webpack-stats.json` that `webpack-bundle-tracker` outputs has changed starting at version `1.0.0-alpha.1`. Starting at `django-webpack-loader==1.0.0`, this is the only formatting accepted here, meaning that other versions of that package don't output compatible files anymore, thereby breaking compatibility with older `webpack-bundle-tracker` releases.
41+
42+
<br>
43+
3644
## Configuration
3745

3846
<br>

examples/code-splitting/app/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
WEBPACK_LOADER = {
110110
'DEFAULT': {
111111
'BUNDLE_DIR_NAME': 'bundles/',
112-
'STATS_FILE': os.path.join(BASE_DIR, 'assets/bundles/webpack-stats.json')
112+
'STATS_FILE': os.path.join(BASE_DIR, 'webpack-stats.json')
113113
}
114114
}
115115

examples/code-splitting/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"react": "^16.11.0",
1414
"react-dom": "^16.11.0",
1515
"webpack": "^4.0.0",
16-
"webpack-bundle-tracker": "1.0.0-alpha.1",
16+
"webpack-bundle-tracker": "1.0.0",
1717
"webpack-cli": "^3.3.10",
1818
"webpack-dev-server": "^3.0.0"
1919
}

examples/hot-reload/app/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
WEBPACK_LOADER = {
110110
'DEFAULT': {
111111
'BUNDLE_DIR_NAME': 'bundles/',
112-
'STATS_FILE': os.path.join(BASE_DIR, 'assets/bundles/webpack-stats.json')
112+
'STATS_FILE': os.path.join(BASE_DIR, 'webpack-stats.json')
113113
}
114114
}
115115

examples/hot-reload/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"react": "^16.11.0",
1616
"react-dom": "^16.11.0",
1717
"webpack": "^4.0.0",
18-
"webpack-bundle-tracker": "1.0.0-alpha.1",
18+
"webpack-bundle-tracker": "1.0.0",
1919
"webpack-cli": "^3.3.10",
2020
"webpack-dev-server": "^3.0.0"
2121
}

examples/simple/app/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
WEBPACK_LOADER = {
110110
'DEFAULT': {
111111
'BUNDLE_DIR_NAME': 'bundles/',
112-
'STATS_FILE': os.path.join(BASE_DIR, 'assets/bundles/webpack-stats.json')
112+
'STATS_FILE': os.path.join(BASE_DIR, 'webpack-stats.json')
113113
}
114114
}
115115

examples/simple/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"react": "^16.11.0",
1616
"react-dom": "^16.11.0",
1717
"webpack": "^4.0.0",
18-
"webpack-bundle-tracker": "1.0.0-alpha.1",
18+
"webpack-bundle-tracker": "1.0.0",
1919
"webpack-cli": "^3.3.10",
2020
"webpack-dev-server": "^3.0.0"
2121
}

0 commit comments

Comments
 (0)