From 3a307fae22b720863174d01ebbf566ba6d361284 Mon Sep 17 00:00:00 2001 From: Sergei Maertens Date: Thu, 2 May 2024 10:57:07 +0200 Subject: [PATCH] :hammer: Use esbuild to bundle for django staticfiles The cookiebar module TS source is taken as input, and the resulting bundle written to the cookie consent staticfiles directory. --- .../static/cookie_consent/cookiebar.module.js | 306 ++++++------- .../cookie_consent/cookiebar.module.js.map | 7 + js/package-lock.json | 407 ++++++++++++++++++ js/package.json | 6 +- 4 files changed, 552 insertions(+), 174 deletions(-) create mode 100644 cookie_consent/static/cookie_consent/cookiebar.module.js.map diff --git a/cookie_consent/static/cookie_consent/cookiebar.module.js b/cookie_consent/static/cookie_consent/cookiebar.module.js index af27203..3a7b9b8 100644 --- a/cookie_consent/static/cookie_consent/cookiebar.module.js +++ b/cookie_consent/static/cookie_consent/cookiebar.module.js @@ -1,203 +1,163 @@ -/** - * Cookiebar functionality, as a Javascript module. - * - * About modules: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules - * - * The code is organized here in a way to make the templates work with Django's page - * cache. This means that anything user-specific (so different django session and even - * cookie consent cookies) cannot be baked into the templates, as that breaks caches. - * - * The cookie bar operates on the following principles: - * - * - The developer using the library includes the desired template in their django - * templates, using the HTML