From f7305d1d006967ce49e9ea3d5d1659113ee1b3ad Mon Sep 17 00:00:00 2001 From: witold Date: Mon, 6 Mar 2023 12:34:44 +0100 Subject: [PATCH 1/2] chore: treat login css as static file --- euphrosyne/assets/js/pages/login.js | 1 - euphrosyne/{assets => static}/css/login.css | 0 euphrosyne/templates/euphro_admin/login.html | 2 +- euphrosyne/templates/registration/password_reset_complete.html | 2 +- euphrosyne/templates/registration/password_reset_confirm.html | 2 +- euphrosyne/templates/registration/password_reset_done.html | 2 +- euphrosyne/templates/registration/password_reset_form.html | 2 +- 7 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 euphrosyne/assets/js/pages/login.js rename euphrosyne/{assets => static}/css/login.css (100%) diff --git a/euphrosyne/assets/js/pages/login.js b/euphrosyne/assets/js/pages/login.js deleted file mode 100644 index ae12d4cec..000000000 --- a/euphrosyne/assets/js/pages/login.js +++ /dev/null @@ -1 +0,0 @@ -import "../../css/login.css"; diff --git a/euphrosyne/assets/css/login.css b/euphrosyne/static/css/login.css similarity index 100% rename from euphrosyne/assets/css/login.css rename to euphrosyne/static/css/login.css diff --git a/euphrosyne/templates/euphro_admin/login.html b/euphrosyne/templates/euphro_admin/login.html index 6c957cc67..fe425bbd7 100644 --- a/euphrosyne/templates/euphro_admin/login.html +++ b/euphrosyne/templates/euphro_admin/login.html @@ -3,7 +3,7 @@ {% block extrastyle %} - + {{ block.super }} {{ form.media }} {% endblock %} diff --git a/euphrosyne/templates/registration/password_reset_complete.html b/euphrosyne/templates/registration/password_reset_complete.html index c250bc04b..3847b090b 100644 --- a/euphrosyne/templates/registration/password_reset_complete.html +++ b/euphrosyne/templates/registration/password_reset_complete.html @@ -3,7 +3,7 @@ {% block extrastyle %} - + {{ block.super }} {{ form.media }} {% endblock %} diff --git a/euphrosyne/templates/registration/password_reset_confirm.html b/euphrosyne/templates/registration/password_reset_confirm.html index ae2b8be98..00e730a67 100644 --- a/euphrosyne/templates/registration/password_reset_confirm.html +++ b/euphrosyne/templates/registration/password_reset_confirm.html @@ -3,7 +3,7 @@ {% block extrastyle %} - + {{ block.super }} {{ form.media }} {% endblock %} diff --git a/euphrosyne/templates/registration/password_reset_done.html b/euphrosyne/templates/registration/password_reset_done.html index 0aed5f981..ee01738ca 100644 --- a/euphrosyne/templates/registration/password_reset_done.html +++ b/euphrosyne/templates/registration/password_reset_done.html @@ -3,7 +3,7 @@ {% block extrastyle %} - + {{ block.super }} {{ form.media }} {% endblock %} diff --git a/euphrosyne/templates/registration/password_reset_form.html b/euphrosyne/templates/registration/password_reset_form.html index 55904ce63..20766eef6 100644 --- a/euphrosyne/templates/registration/password_reset_form.html +++ b/euphrosyne/templates/registration/password_reset_form.html @@ -3,7 +3,7 @@ {% block extrastyle %} - + {{ block.super }} {{ form.media }} {% endblock %} From 0da7e063380340c1fa928b2698537f0970fb4f42 Mon Sep 17 00:00:00 2001 From: witold Date: Mon, 6 Mar 2023 12:36:20 +0100 Subject: [PATCH 2/2] fix: update path lookup for purge css --- webpack.config.js | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 3d28b5aed..596c0e71b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -9,15 +9,6 @@ import CssMinimizerPlugin from "css-minimizer-webpack-plugin"; import { PurgeCSSPlugin } from "purgecss-webpack-plugin"; import webpack from "webpack"; -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); - -const PATHS = { - euphrosyne: path.join(__dirname, "euphrosyne"), - euphro_auth: path.join(__dirname, "euphro_auth"), - lab: path.join(__dirname, "lab"), -}; - export default { entry: { main: [ @@ -98,16 +89,10 @@ export default { }), new MiniCssExtractPlugin(), new PurgeCSSPlugin({ - paths: globSync( - [ - `${PATHS.euphrosyne}/**/*`, - `${PATHS.euphro_auth}/**/*`, - `${PATHS.lab}/**/*`, - ], - { - nodir: true, - } - ), + paths: globSync([`{euphrosyne,euphro_auth,lab}/**/*`], { + nodir: true, + dotRelative: true, + }), }), ], };