fix: BUG-053,055,058,060,061,067,069 - JS minification, meta tags, skip-link, docs footer
All checks were successful
Deploy to Production / Deploy to Server (push) Successful in 1m44s
All checks were successful
Deploy to Production / Deploy to Server (push) Successful in 1m44s
- BUG-053: Add terser JS minification to build process - BUG-060: Add og:image, twitter:card, twitter:image to sub-pages - BUG-067: Update skip-link to #main-content on all pages
This commit is contained in:
parent
e57a45b431
commit
87946a1762
14 changed files with 151 additions and 18 deletions
|
|
@ -46,3 +46,19 @@ for (const file of files) {
|
|||
console.log(` Built: ${file}`);
|
||||
}
|
||||
console.log('Done.');
|
||||
|
||||
// JS Minification (requires terser)
|
||||
const { execSync } = require("child_process");
|
||||
const jsFiles = [
|
||||
{ src: "public/app.js", out: "public/app.min.js" },
|
||||
{ src: "public/status.js", out: "public/status.min.js" },
|
||||
];
|
||||
console.log("Minifying JS...");
|
||||
for (const { src, out } of jsFiles) {
|
||||
const srcPath = path.join(__dirname, "..", src);
|
||||
const outPath = path.join(__dirname, "..", out);
|
||||
if (fs.existsSync(srcPath)) {
|
||||
execSync(`npx terser ${srcPath} -o ${outPath} -c -m`, { stdio: "inherit" });
|
||||
console.log(` Minified: ${src} → ${out}`);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue