{"id":24021,"date":"2024-01-18T09:03:40","date_gmt":"2024-01-18T08:03:40","guid":{"rendered":"https:\/\/nelkodev.com\/blog\/guia-tutorial-inicial-de-rollup-automatizador-javascript-en-espanol\/"},"modified":"2024-06-03T17:34:20","modified_gmt":"2024-06-03T16:34:20","slug":"guia-tutorial-inicial-de-rollup-automatizador-javascript-en-espanol","status":"publish","type":"post","link":"https:\/\/nelkodev.com\/en\/blog\/initial-javascript-automator-rollup-tutorial-guide-in-spanish\/","title":{"rendered":"Rollup Getting Started Tutorial Guide: JavaScript Automator in Spanish"},"content":{"rendered":"<p>In this initial Rollup tutorial guide, we will teach you how to use this JavaScript automator in Spanish. Rollup is a module building tool that allows you to create efficient and optimized bundles for your web application. With Rollup, you can easily organize and manage your project&#039;s dependencies, helping you maintain clean and modular code.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #ffffff;color:#ffffff\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #ffffff;color:#ffffff\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/nelkodev.com\/en\/blog\/initial-javascript-automator-rollup-tutorial-guide-in-spanish\/#%C2%BFQue_es_Rollup\" >What is Rollup?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/nelkodev.com\/en\/blog\/initial-javascript-automator-rollup-tutorial-guide-in-spanish\/#Configuracion_inicial_de_Rollup\" >Initial Rollup Setup<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/nelkodev.com\/en\/blog\/initial-javascript-automator-rollup-tutorial-guide-in-spanish\/#Creacion_del_bundle_con_Rollup\" >Creating the bundle with Rollup<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/nelkodev.com\/en\/blog\/initial-javascript-automator-rollup-tutorial-guide-in-spanish\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/nelkodev.com\/en\/blog\/initial-javascript-automator-rollup-tutorial-guide-in-spanish\/#Preguntas_frecuentes\" >Frequently asked questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/nelkodev.com\/en\/blog\/initial-javascript-automator-rollup-tutorial-guide-in-spanish\/#1_%C2%BFCuales_son_las_ventajas_de_utilizar_Rollup_en_comparacion_con_otros_automatizadores\" >1. What are the advantages of using Rollup compared to other automators?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/nelkodev.com\/en\/blog\/initial-javascript-automator-rollup-tutorial-guide-in-spanish\/#2_%C2%BFCuando_deberia_considerar_utilizar_Rollup_en_lugar_de_webpack_o_gulp\" >2. When should I consider using Rollup instead of webpack or gulp?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/nelkodev.com\/en\/blog\/initial-javascript-automator-rollup-tutorial-guide-in-spanish\/#3_%C2%BFPuedo_utilizar_Rollup_en_conjunto_con_otros_automatizadores\" >3. Can I use Rollup in conjunction with other automators?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/nelkodev.com\/en\/blog\/initial-javascript-automator-rollup-tutorial-guide-in-spanish\/#4_%C2%BFExiste_alguna_alternativa_a_Rollup\" >4. Is there an alternative to Rollup?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%C2%BFQue_es_Rollup\"><\/span>What is Rollup?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Rollup is a module building tool used to create efficient JavaScript bundles. Unlike other automators such as webpack or gulp, Rollup focuses on the construction of modules, which allows generating smaller and more optimized bundles. This is achieved by removing unused code and applying minification techniques.<\/p>\n<p>Additionally, Rollup is especially suitable for projects that use ES6 module syntax, as it can automatically transform your code from ES6 to ES5, thus ensuring compatibility with older browsers.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Configuracion_inicial_de_Rollup\"><\/span>Initial Rollup Setup<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To start using Rollup in your project, you will need to configure your configuration file (usually called <code>rollup.config.js<\/code>). Here, you must specify the input of your application as well as the desired output. You can also add additional plugins according to your needs.<\/p>\n<p>For example, here is a basic configuration file:<\/p>\n<pre><code>import babel from &#039;rollup-plugin-babel&#039;; export default { input: &#039;src\/main.js&#039;, output: { file: &#039;dist\/bundle.js&#039;, format: &#039;umd&#039;, name: &#039;myApp&#039; }, plugins: [ babel() ] };\n<\/code><\/pre>\n<p>In this example, we are using the Babel plugin to transform our code from ES6 to ES5 before generating the final bundle. Specifically, we&#039;re using ES6&#039;s import\/export syntax, which Rollup can handle just fine.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Creacion_del_bundle_con_Rollup\"><\/span>Creating the bundle with Rollup<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Once you have configured your configuration file, you can run Rollup to create your bundle. This can be done from the command line or through a script in your file <code>package.json<\/code>.<\/p>\n<p>To run Rollup from the command line, simply navigate to your project directory and run the following command:<\/p>\n<pre><code>npx rollup -c<\/code><\/pre>\n<p>This will tell Rollup to use the file <code>rollup.config.js<\/code> to generate the bundle. If you want to specify a different configuration file, you can use the option <code>-c<\/code> followed by the file name.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In short, Rollup is a powerful tool for automating the construction of modules in JavaScript. With its focus on modules and its ability to generate small, optimized bundles, Rollup is an ideal option for those looking for a lighter and more efficient solution than other automators such as webpack or gulp.<\/p>\n<p>We hope this initial Rollup tutorial guide has helped you understand how to use this tool in your projects. If you have any questions or comments, don&#039;t hesitate to contact us!<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Preguntas_frecuentes\"><\/span>Frequently asked questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"1_%C2%BFCuales_son_las_ventajas_de_utilizar_Rollup_en_comparacion_con_otros_automatizadores\"><\/span>1. What are the advantages of using Rollup compared to other automators?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Rollup stands out for its focus on modules and its ability to generate smaller, more optimized bundles. This means that your web applications will be faster and more efficient. Additionally, Rollup is easy to set up and has a large developer community that can provide support if you need it.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_%C2%BFCuando_deberia_considerar_utilizar_Rollup_en_lugar_de_webpack_o_gulp\"><\/span>2. When should I consider using Rollup instead of webpack or gulp?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If your project is based on modules and you want to generate smaller, more optimized bundles, Rollup is an excellent option. However, if your application is more complex and requires features such as advanced loaders or support for additional tasks beyond building modules, webpack or gulp may be more suitable for you.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_%C2%BFPuedo_utilizar_Rollup_en_conjunto_con_otros_automatizadores\"><\/span>3. Can I use Rollup in conjunction with other automators?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes, you can use Rollup in conjunction with other automators. For example, you can use Rollup to build your modules and then use webpack or gulp to perform additional tasks such as file minification or static asset management.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_%C2%BFExiste_alguna_alternativa_a_Rollup\"><\/span>4. Is there an alternative to Rollup?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Some popular alternatives to Rollup are webpack, gulp and Parcel. Each of these tools has its own features and strengths, so it&#039;s important to evaluate your needs before deciding which one to use.<\/p>","protected":false},"excerpt":{"rendered":"<p>En esta gu\u00eda tutorial inicial de Rollup, te ense\u00f1aremos c\u00f3mo utilizar este automatizador de JavaScript en espa\u00f1ol. Rollup es una herramienta de construcci\u00f3n de m\u00f3dulos que te permite crear bundles eficientes y optimizados para tu aplicaci\u00f3n web. Con Rollup, puedes organizar y gestionar f\u00e1cilmente las dependencias de tu proyecto, lo que te ayudar\u00e1 a mantener [&hellip;]<\/p>","protected":false},"author":1,"featured_media":24022,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1126,420],"tags":[1175,637,205,580,358,635,185,971,485],"class_list":["post-24021","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-automatizadores","category-blog","tag-automatizador","tag-automatizadores","tag-blog","tag-espanol","tag-guia","tag-inicial","tag-javascript","tag-rollup","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/posts\/24021","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/comments?post=24021"}],"version-history":[{"count":0,"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/posts\/24021\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/media\/24022"}],"wp:attachment":[{"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/media?parent=24021"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/categories?post=24021"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/tags?post=24021"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}