myetv-player 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.js CHANGED
@@ -147,14 +147,20 @@ function buildJavaScript() {
147
147
  function minifyJSNative() {
148
148
  const jsFile = './dist/myetv-player.js';
149
149
  const minFile = './dist/myetv-player.min.js';
150
+
150
151
  try {
151
152
  let code = fs.readFileSync(jsFile, 'utf8');
153
+
152
154
  code = code.replace(/\/\*[\s\S]*?\*\//g, '');
153
- code = code.replace(/(^|\s)\/\/.*$/gm, '');
154
- code = code.split('\\n').map(line => line.trim()).filter(line => line.length > 0).join(' ');
155
+ code = code.replace(/^\s*\/\/.*$/gm, '');
156
+
157
+ code = code.replace(/\n\s*\n\s*\n/g, '\n\n');
158
+
159
+ code = code.replace(/ +/g, ' ');
160
+
155
161
  fs.writeFileSync(minFile, code);
156
162
  console.log(`✓ JS (minified native) created: ${minFile}`);
157
- console.log(` File size: ${(code.length / 1024).toFixed(2)} KB`);
163
+ console.log(` File size: ${(code.length / 1024).toFixed(2)} KB`);
158
164
  } catch (err) {
159
165
  console.log('✗ Native JS minification failed:', err.message);
160
166
  }