Fix issues with the minify in translate (#7211)
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
Emmanuel Ferdman committed
Aug 6, 2025 at 11:43 UTC
793ec3384c34e8812297b84db027fc510f71c83e
1 file changed
+7
-7
translate/translate.js
+7
-7
@@ -358,7 +358,7 @@ async function startEx(argv) {
358
if (sourceFiles[i].endsWith('.js')) {
359
// Minify the file .js file
360
const destinationFile = path.join(argv[4], sourceFiles[i].substring(0, sourceFiles[i].length - 3) + '.min.js');
361
- if (minifyLib = 2) {
361
+ if (minifyLib == 2) {
362
var inFile = fs.readFileSync(sourceFile).toString();
363
364
// Perform minification pre-processing
@@ -423,7 +423,7 @@ async function startEx(argv) {
423
dist: outnamemin
424
}, function (e, compress) {
425
if (e) { log('ERROR ', e); return done(); }
426
- compress.run((e) => { e ? log('Minification fail', e) : log('Minification sucess'); minifyDone(); });
426
+ compress.run((e) => { e ? log('Minification fail', e) : log('Minification success'); minifyDone(); });
427
}
428
);
429
}
@@ -500,7 +500,7 @@ async function startEx(argv) {
500
log('Generating ' + path.basename(outnamemin) + '...');
501
502
// Minify the file
503
- if (minifyLib = 2) {
503
+ if (minifyLib == 2) {
504
var inFile = fs.readFileSync(outname).toString()
505
506
// Perform minification pre-processing
@@ -980,13 +980,13 @@ async function translateFromHtml(lang, file, createSubDir) {
980
dist: outnamemin
981
}, function(e, compress) {
982
if (e) { log('ERROR ', e); return done(); }
983
- compress.run((e) => { e ? log('Minification fail', e) : log('Minification sucess'); minifyDone(); });
983
+ compress.run((e) => { e ? log('Minification fail', e) : log('Minification success'); minifyDone(); });
984
}
985
);
986
}
987
988
// Minify the file
989
- if (minifyLib = 2) {
989
+ if (minifyLib == 2) {
990
if (outnamemin.endsWith('.handlebars') >= 0) { out = out.split('{{{pluginHandler}}}').join('"{{{pluginHandler}}}"'); }
991
var minifiedOut = await minify(out, {
992
collapseBooleanAttributes: true,
@@ -1130,7 +1130,7 @@ function InstallModuleEx(modulenames, func) {
1130
InstallModuleChildProcess = child_process.exec(`npm install --no-audit --no-optional --omit=optional ${names}`, { maxBuffer: 512000, timeout: 300000, cwd: parentpath }, function (error, stdout, stderr) {
1131
InstallModuleChildProcess = null;
1132
if ((error != null) && (error != '')) {
1133
- log('ERROR: Unable to install required modules. May not have access to npm, or npm may not have suffisent rights to load the new modules. Try "npm install ' + names + '" to manualy install the modules.\r\n');
1133
+ log('ERROR: Unable to install required modules. May not have access to npm, or npm may not have suffisent rights to load the new modules. Try "npm install ' + names + '" to manually install the modules.\r\n');
1134
process.exit();
1135
return;
1136
}
@@ -1156,4 +1156,4 @@ function translationsToJson(t) {
1156
}
1157
1158
// Export table
1159
-module.exports.startEx = startEx;
\ No newline at end of file
1159
+module.exports.startEx = startEx;