RevealTheme logo

Minifieur JavaScript

Minification basique de JavaScript : supprime les commentaires et les espaces inutiles. Utilisez un véritable minifieur (Terser, esbuild) pour la production.

Comment utiliser cet outil

  1. 1

    Paste or type your JavaScript into the input textarea.

  2. 2

    The minified output appears instantly in the panel below as you type — there is no button to press.

  3. 3

    Check the size readout (original length, an arrow, and minified length) to see how much was removed.

  4. 4

    Select the text in the output box and copy it manually into your file.

Qu'est-ce que le minifieur JavaScript ?

La minification de JavaScript réduit la taille du bundle et le temps d'analyse. Cet outil effectue une suppression basique des espaces et des commentaires. Pour les bundles de production, utilisez Terser, esbuild ou SWC : ils réalisent l'obfuscation des noms et l'élimination du code mort, ce qui produit une sortie nettement plus légère (souvent une réduction de 60 % à 80 %).

Cas d'usage courants

  • Quickly shrinking a short, comment-heavy snippet before pasting it into a tight inline <script> tag.

  • Stripping comments out of a code sample to share a compact version in a chat or gist.

  • Estimating roughly how much comment and whitespace overhead a small file carries before setting up a real build.

  • Cleaning up a hand-written configuration object or constant block that has no strings containing slashes.

  • Demonstrating to students or teammates what basic comment and whitespace removal looks like versus a real compiler.

  • Minifying a tiny utility function for a bookmarklet where pulling in a full toolchain is overkill.

Questions fréquentes

Comment se compare-t-il à Terser ?
Terser est bien plus agressif : obfuscation des noms, élimination du code mort, etc. Cet outil ne fait que supprimer les commentaires et les espaces.
Est-ce que cela va casser mon code ?
Seulement si votre JS présente des problèmes de syntaxe (points-virgules manquants dans des positions ambiguës). Le JavaScript moderne ne risque rien.

Outils connexes