mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
lint: Run eslint --fix
on src/
This commit is contained in:
parent
b8d07a42eb
commit
8e5fd19db2
109 changed files with 9061 additions and 10572 deletions
|
@ -2,10 +2,10 @@
|
|||
* Worker thread to minify JS & CSS files out of the main NodeJS thread
|
||||
*/
|
||||
|
||||
var CleanCSS = require('clean-css');
|
||||
var Terser = require("terser");
|
||||
var path = require('path');
|
||||
var Threads = require('threads')
|
||||
const CleanCSS = require('clean-css');
|
||||
const Terser = require('terser');
|
||||
const path = require('path');
|
||||
const Threads = require('threads');
|
||||
|
||||
function compressJS(content) {
|
||||
return Terser.minify(content);
|
||||
|
@ -46,20 +46,20 @@ function compressCSS(filename, ROOT_DIR) {
|
|||
new CleanCSS({
|
||||
rebase: true,
|
||||
rebaseTo: basePath,
|
||||
}).minify([absPath], function (errors, minified) {
|
||||
if (errors) return rej(errors)
|
||||
}).minify([absPath], (errors, minified) => {
|
||||
if (errors) return rej(errors);
|
||||
|
||||
return res(minified.styles)
|
||||
return res(minified.styles);
|
||||
});
|
||||
} catch (error) {
|
||||
// on error, just yield the un-minified original, but write a log message
|
||||
console.error(`Unexpected error minifying ${filename} (${absPath}): ${error}`);
|
||||
callback(null, content);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
Threads.expose({
|
||||
compressJS,
|
||||
compressCSS
|
||||
})
|
||||
compressCSS,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue