From 9f8403c760da8f6d1142d122fead216c41d3a913 Mon Sep 17 00:00:00 2001 From: josc146 Date: Fri, 17 Mar 2023 11:55:51 +0800 Subject: [PATCH] chore: inline svg to save traffic --- build.mjs | 2 +- src/popup/Popup.jsx | 7 ++----- src/popup/donation/bugmeacoffee.svg | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 src/popup/donation/bugmeacoffee.svg diff --git a/build.mjs b/build.mjs index 2c4ed6ce..d118bed7 100644 --- a/build.mjs +++ b/build.mjs @@ -169,7 +169,7 @@ async function runWebpack(isWithoutKatex, callback) { type: 'asset/inline', }, { - test: /\.jpg$/, + test: /\.(jpg|svg)$/, type: 'asset/inline', }, ], diff --git a/src/popup/Popup.jsx b/src/popup/Popup.jsx index 879f171c..68a3170b 100644 --- a/src/popup/Popup.jsx +++ b/src/popup/Popup.jsx @@ -18,6 +18,7 @@ import Browser from 'webextension-polyfill' import PropTypes from 'prop-types' import { config as toolsConfig } from '../content-script/selection-tools' import wechatpay from './donation/wechatpay.jpg' +import bugmeacoffee from './donation/bugmeacoffee.svg' function GeneralPart({ config, updateConfig }) { const [balance, setBalance] = useState(null) @@ -336,11 +337,7 @@ function Donation() { target="_blank" rel="nofollow noopener noreferrer" > - buymeacoffee + buymeacoffee
<> diff --git a/src/popup/donation/bugmeacoffee.svg b/src/popup/donation/bugmeacoffee.svg new file mode 100644 index 00000000..ef9943ea --- /dev/null +++ b/src/popup/donation/bugmeacoffee.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + +