Skip to content

Commit

Permalink
Adds contents hash to improve caching webpack output
Browse files Browse the repository at this point in the history
  • Loading branch information
melegiul committed Sep 20, 2021
1 parent 38c0601 commit d1677de
Show file tree
Hide file tree
Showing 18 changed files with 679 additions and 489 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ sphinx/templates/breadcrumbs.html*
.directory
cms-django.iml
integreat-cms.iml
webpack-stats.json

# Media Library
src/media/
Expand Down
644 changes: 356 additions & 288 deletions Pipfile.lock

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion dev-tools/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ echo -e "Starting WebPack dev server in background..." | print_info | print_pref
deescalate_privileges npm run dev 2>&1 | print_prefix "webpack" 36 &

# Waiting for initial WebPack dev build
while [[ ! -f "${BASE_DIR}/src/cms/static/main.js" ]]; do sleep 1; done
compgen -G "${BASE_DIR}/src/cms/static/main.*.js" > /dev/null
while [[ $? -eq 1 ]]; do
sleep 1
compgen -G "${BASE_DIR}/src/cms/static/main.*.js" > /dev/null
done

# Show success message once dev server is up
listen_for_devserver &
Expand Down
95 changes: 91 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "CMS developed by the Integreat-Team",
"scripts": {
"dev": "NODE_ENV=development webpack serve --mode development --color --stats=errors-warnings",
"dev": "NODE_ENV=development webpack watch --mode development --color --stats=errors-warnings",
"prod": "NODE_ENV=production webpack --mode production"
},
"repository": {
Expand Down Expand Up @@ -69,6 +69,7 @@
"tailwindcss": "^2.2.4",
"tinymce": "^5.8.2",
"tinymce-i18n": "20.12.25",
"webpack-bundle-tracker": "^1.3.0",
"whatwg-fetch": "^3.6.2"
}
}
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"django-linkcheck",
"django-mptt",
"django-widget-tweaks",
"django-webpack-loader",
"feedparser",
"idna",
"lxml",
Expand Down
13 changes: 13 additions & 0 deletions src/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
"mptt",
"rules.apps.AutodiscoverRulesConfig",
"linkcheck",
"webpack_loader",
]

# The default Django Admin application will only be activated if the system is in debug mode.
Expand Down Expand Up @@ -676,3 +677,15 @@
#############################

CHANNELS = (("News", "News"),)


#########################
# DJANGO WEBPACK LOADER #
#########################

#: Overwrite default bundle directory
WEBPACK_LOADER = {
"DEFAULT": {
"BUNDLE_DIR_NAME": "",
}
}
Loading

0 comments on commit d1677de

Please sign in to comment.