En este tutorial aprenderemos cómo minimizar(minify) un fichero Js para mejorar la velocidad de carga de nuestro sitio web. El proceso es muy sencillo. Sólo debemos copiar el contenido de nuestro fichero y acceder a la página https://javascript-minifier.comPágina javascript-minifier.comHacemos click con el botón derecho del ratón en el recuadro «input JavaScript» y pegamos el contenido que copiamos de nuestro fichero Js.Pegar contenidoSi como en el ejemplo, el botón de «Minify» no se activa, seguramente es porque hay una línea de más. Deberemos borrarla y ya podremos hacer click en el botón.Minimizar fichero jsPulsamos el botón «Minify» y vemos como aparece el código minimizado en el recuadro derechoFichero js minimizadoHacemos click con el botón derecho sobre él copiamos el contenido. El siguiente paso es crear un fichero con el mismo nombre que el original que queremos minimizar y añadirle al final la extensión «.min.js«. Cambiaremos todos los enlaces al fichero con la nueva ruta y ya habremos terminado. Es recomendable mantener el fichero original por si necesitamos hacer algún cambio, porque el fichero minimizado es ininteligible.
Si te ha gustado no olvides compartir en redes sociales.
Espero que te haya servido. Cualquier duda deja un comentario. Un saludo
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.