From e0b6d079b536038eacb2ef2718ba55ece466b0cb Mon Sep 17 00:00:00 2001 From: Quorafind Date: Wed, 3 Dec 2025 07:49:50 +0800 Subject: [PATCH] chore(build): remove unused CSS processing plugins from esbuild config --- esbuild.config.mjs | 44 +------------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/esbuild.config.mjs b/esbuild.config.mjs index e416fd1a..2a524ba6 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -20,48 +20,6 @@ if you want to view the source, please visit the github repository of this plugi */ `; -// Custom plugin to add CSS settings comment at the top of the CSS file -const cssSettingsPlugin = { - name: "css-settings-plugin", - setup(build) { - build.onEnd(async (result) => { - // Path to the output CSS file - const cssOutfile = "styles.css"; - - // The settings comment to prepend - const settingsComment = - fs.readFileSync("src/styles/index.css", "utf8").split("*/")[0] + - "*/\n\n"; - - if (fs.existsSync(cssOutfile)) { - // Read the current content - const cssContent = fs.readFileSync(cssOutfile, "utf8"); - - // Check if the settings comment is already there - if (!cssContent.includes("/* @settings")) { - // Prepend the settings comment - fs.writeFileSync(cssOutfile, settingsComment + cssContent); - } - } - }); - }, -}; - -const renamePlugin = { - name: "rename-styles", - setup(build) { - build.onEnd(() => { - const { outfile } = build.initialOptions; - const outcss = outfile.replace(/\.js$/, ".css"); - const fixcss = outfile.replace(/main\.js$/, "styles.css"); - if (fs.existsSync(outcss)) { - console.log("Renaming", outcss, "to", fixcss); - fs.renameSync(outcss, fixcss); - } - }); - }, -}; - const prod = process.argv[2] === "production"; const outDir = prod ? "dist" : "."; @@ -121,7 +79,7 @@ const copyManifestPlugin = { if (prod) { fs.copyFileSync( "manifest.json", - path.join(outDir, "manifest.json") + path.join(outDir, "manifest.json"), ); console.log("Copied manifest.json to", outDir); }