This commit is contained in:
Alphons Joseph
2025-02-11 19:04:04 +08:00
3 changed files with 41 additions and 3 deletions
+25
View File
@@ -0,0 +1,25 @@
// ref: https://stackoverflow.com/a/76920975
import type { Plugin } from 'vite';
export default function ClosePlugin(): Plugin {
return {
name: 'ClosePlugin', // required, will show up in warnings and errors
// use this to catch errors when building
buildEnd(error) {
if(error) {
console.error('Error bundling')
console.error(error)
process.exit(1)
} else {
console.log('Build ended')
}
},
// use this to catch the end of a build without errors
closeBundle() {
console.log('Bundle closed')
process.exit(0)
},
}
}
+11
View File
@@ -165,6 +165,17 @@ export function OpenWhatsNewPopup() {
/* html */ `
<div class="whatsnewTextContainer" style="height: 50%;overflow-y: scroll;">
<h1>3.4.4 - Bug Fixes and Improvements</h1>
<li>Removed broken gradients on the backgrounds of certain buttons</li>
<li>Fixed timetable quickbar arrow receiving the wrong colour</li>
<li>Auto-applied selected theme after saving in theme creator</li>
<li>Fixed a bug where timetable was clipped at certain times</li>
<li>Improved spacing of the message editor buttons</li>
<li>Added HEX colour input to the theme creator</li>
<li>Fixed theme application in the creator</li>
<li>Performance improvements</li>
<li>Other minor bug fixes</li>
<h1>3.4.3 - Minor Bug Fixes</h1>
<li>Fixed a bug where timetable colours couldn't be changed</li>
<li>Other minor bug fixes</li>
+5 -3
View File
@@ -4,6 +4,7 @@ import { join, resolve } from 'path';
import { updateManifestPlugin } from './lib/patchPackage';
import { base64Loader } from './lib/base64loader';
import type { BuildTarget } from './lib/types';
import ClosePlugin from './lib/closePlugin';
import react from '@vitejs/plugin-react';
import million from "million/compiler";
@@ -25,7 +26,7 @@ const targets: BuildTarget[] = [
const mode = process.env.MODE || 'chrome';
export default defineConfig({
export default defineConfig(({ command }) => ({
plugins: [
base64Loader,
react(),
@@ -38,7 +39,8 @@ export default defineConfig({
manifest: targets.find(t => t.browser === mode.toLowerCase())?.manifest ?? chrome.manifest,
browser: mode.toLowerCase() === "firefox" ? "firefox" : "chrome"
}),
updateManifestPlugin()
updateManifestPlugin(),
...(command === 'build' ? [ClosePlugin()] : [])
],
root: resolve(__dirname, './src'),
resolve: {
@@ -78,4 +80,4 @@ export default defineConfig({
}
}
}
});
}));