mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
lint: src/node/utils/MinifyWorker.js
This commit is contained in:
parent
b5e04d867e
commit
b11ba23208
1 changed files with 20 additions and 23 deletions
|
@ -1,3 +1,4 @@
|
|||
'use strict';
|
||||
/**
|
||||
* Worker thread to minify JS & CSS files out of the main NodeJS thread
|
||||
*/
|
||||
|
@ -7,12 +8,9 @@ const Terser = require('terser');
|
|||
const path = require('path');
|
||||
const Threads = require('threads');
|
||||
|
||||
function compressJS(content) {
|
||||
return Terser.minify(content);
|
||||
}
|
||||
const compressJS = (content) => Terser.minify(content);
|
||||
|
||||
function compressCSS(filename, ROOT_DIR) {
|
||||
return new Promise((res, rej) => {
|
||||
const compressCSS = (filename, ROOT_DIR) => new Promise((res, rej) => {
|
||||
try {
|
||||
const absPath = path.join(ROOT_DIR, filename);
|
||||
|
||||
|
@ -57,7 +55,6 @@ function compressCSS(filename, ROOT_DIR) {
|
|||
callback(null, content);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Threads.expose({
|
||||
compressJS,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue