Warning: mkdir(): No space left on device in /var/www/tgoop/post.php on line 37

Warning: file_put_contents(aCache/aDaily/post/frontend_1/--): Failed to open stream: No such file or directory in /var/www/tgoop/post.php on line 50
Frontend разработчик@frontend_1 P.3958
FRONTEND_1 Telegram 3958
🔎 Как "убить" ненужный console.log в проде — элегантно

Многие забывают удалять console.log, warn, error перед продом. Это 💩 и баги безопасности, и просто шум. Есть изящное решение — удаление логов на этапе сборки.

Для Vite / Rollup / esbuild / Terser — добавьте:

🔧 Terser (например, в Vite):

// vite.config.ts
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
},
}


⚙️ Esbuild:

esbuild: {
drop: ['console', 'debugger'],
}


💡 Совет:
Если используете логгер типа logger.info(...), настройте статический анализ через Babel plugin или tree-shaking.

Важно: не отключайте console.error на деве — это может скрыть критичные баги.

🧼 Чистый прод = меньше багов + быстрее загрузка

👉 @frontend_1
👍13



tgoop.com/frontend_1/3958
Create:
Last Update:

🔎 Как "убить" ненужный console.log в проде — элегантно

Многие забывают удалять console.log, warn, error перед продом. Это 💩 и баги безопасности, и просто шум. Есть изящное решение — удаление логов на этапе сборки.

Для Vite / Rollup / esbuild / Terser — добавьте:

🔧 Terser (например, в Vite):


// vite.config.ts
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
},
}


⚙️ Esbuild:

esbuild: {
drop: ['console', 'debugger'],
}


💡 Совет:
Если используете логгер типа logger.info(...), настройте статический анализ через Babel plugin или tree-shaking.

Важно: не отключайте console.error на деве — это может скрыть критичные баги.

🧼 Чистый прод = меньше багов + быстрее загрузка

👉 @frontend_1

BY Frontend разработчик




Share with your friend now:
tgoop.com/frontend_1/3958

View MORE
Open in Telegram


Telegram News

Date: |

Image: Telegram. So far, more than a dozen different members have contributed to the group, posting voice notes of themselves screaming, yelling, groaning, and wailing in various pitches and rhythms. Administrators For crypto enthusiasts, there was the “gm” app, a self-described “meme app” which only allowed users to greet each other with “gm,” or “good morning,” a common acronym thrown around on Crypto Twitter and Discord. But the gm app was shut down back in September after a hacker reportedly gained access to user data. With the sharp downturn in the crypto market, yelling has become a coping mechanism for many crypto traders. This screaming therapy became popular after the surge of Goblintown Ethereum NFTs at the end of May or early June. Here, holders made incoherent groaning sounds in late-night Twitter spaces. They also role-played as urine-loving Goblin creatures.
from us


Telegram Frontend разработчик
FROM American