From fb005d419f81f0a0ce8b55dd4f003b61f89afe34 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 24 Jul 2024 20:01:27 -0400 Subject: [PATCH] membershipworks: Fix missing bootstrap CSS in invoice PDFs --- js/base.entry.ts | 2 +- js/bootstrap-css-only.entry.ts | 1 + .../templates/membershipworks/event_invoice_pdf.dj.html | 4 ++-- vite.config.js | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 js/bootstrap-css-only.entry.ts diff --git a/js/base.entry.ts b/js/base.entry.ts index f3e936f..a88f5a2 100644 --- a/js/base.entry.ts +++ b/js/base.entry.ts @@ -1,3 +1,3 @@ -import "bootstrap/scss/bootstrap.scss"; +import "./bootstrap-css-only.entry.ts"; import "bootstrap-icons/font/bootstrap-icons.css"; import "bootstrap"; diff --git a/js/bootstrap-css-only.entry.ts b/js/bootstrap-css-only.entry.ts new file mode 100644 index 0000000..5290fdb --- /dev/null +++ b/js/bootstrap-css-only.entry.ts @@ -0,0 +1 @@ +import "bootstrap/scss/bootstrap.scss"; diff --git a/membershipworks/templates/membershipworks/event_invoice_pdf.dj.html b/membershipworks/templates/membershipworks/event_invoice_pdf.dj.html index eff5781..8204a29 100644 --- a/membershipworks/templates/membershipworks/event_invoice_pdf.dj.html +++ b/membershipworks/templates/membershipworks/event_invoice_pdf.dj.html @@ -1,13 +1,13 @@ {% load static %} {% load nh3_tags %} +{% load django_vite %} - - + {% vite_asset 'js/bootstrap-css-only.entry.ts' %} {% if preview %} diff --git a/vite.config.js b/vite.config.js index 1f4511d..6ccf7d9 100644 --- a/vite.config.js +++ b/vite.config.js @@ -6,6 +6,7 @@ const entry_points = globbySync("*/js/*.entry.ts", { gitignore: true }); const inputs = { base: "./js/base.entry.ts", + "bootstrap-css-only": "./js/bootstrap-css-only.entry.ts", }; for (const entry of entry_points) {