This commit is contained in:
SamTV12345 2024-06-03 21:48:10 +02:00
parent 5da7345689
commit 7bf84f6a28

View file

@ -9,11 +9,20 @@ import {expose} from 'threads'
import lightminify from 'lightningcss' import lightminify from 'lightningcss'
import {transform} from 'esbuild'; import {transform} from 'esbuild';
const compressJS = async (content: string) => { /*
* Minify JS content
* @param {string} content - JS content to minify
*/
const compressJS = async (content) => {
return await transform(content, {minify: true}); return await transform(content, {minify: true});
} }
const compressCSS = async (filename: string, ROOT_DIR: string) => { /*
* Minify CSS content
* @param {string} filename - name of the file
* @param {string} ROOT_DIR - the root dir of Etherpad
*/
const compressCSS = async (filename, ROOT_DIR) => {
const absPath = path.resolve(ROOT_DIR, filename); const absPath = path.resolve(ROOT_DIR, filename);
try { try {
const basePath = path.dirname(absPath); const basePath = path.dirname(absPath);