ПІДТРИМАЙ УКРАЇНУ ПІДТРИМАТИ АРМІЮ
Uk Uk

How to bundle a simple react application using esbuild

How to bundle a simple react application using esbuild

Overview of how to use esbuild to bundle a basic React application.

Bundling is an important phase in the web development process, particularly when dealing with JavaScript frameworks like React. It entails combining all the various JavaScript files and dependencies into a single file for faster browser loading and execution.

esbuild is a lightweight and efficient bundler for React apps. 

How to Install esbuild Globally

We'll start by installing esbuild globally in your system by running npm install -g esbuild in the command line. This will install the latest version of esbuild globally on your system.

After installation, you can access esbuild from the command line by typing esbuild.

How to Create a New Directory for Your React Application

To create a new directory for your React application, open the terminal and navigate to the directory where you want to create the new directory. Then run the following command:

mkdir my-react-app

This will create a new directory named my-react-app. You can replace it with whatever name you want to give your React application directory.

After creating the directory, navigate into it by running:

cd my-react-app

Initialize a new npm project by running the following command and following the prompts:

npm init -y

Install React and React DOM by running npm install react react-dom in the terminal. This will install the latest versions of React and React DOM in your project, along with any required dependencies.

How to Create the Necessary Files and Folders

Let's create the necessary files and folders. Here's a basic structure:

my-react-app
├── src
| |
│ |── index.js
├── |--- index.html
│ 
└── package.json

Add the code shown below in your app, following the above structure:

index.html:





 
 
 Hello, esbuild!



 

The above code outlines the fundamental structure of an HTML5 web page. It starts with a declaration indicating the use of HTML5. The main structure consists of an  root element containing asection for metadata, including character encoding and viewport settings for responsiveness.

The  </code>element defines the browser tab's title, while the actual content resides in the<code><body></code>element. Within the<code><body></code>, a<code><div></code>element with the id "root" serves as a placeholder for potential dynamic content.</p> <p>Additionally, there's a <code><script> </code>tag pointing to an external JavaScript file named "Bundle.js," generated by esbuild, to be executed by the browser.</p> <p>This structure sets the foundation for building a web page with HTML5, CSS, and JavaScript functionality.</p> <p>index.js</p> <pre><code>import React from "react"; import ReactDOM from "react-dom"; function App() { return ( <div>Hello, esbuild! </div> ); } ReactDOM.render(<App />, document.getElementById("root"));</code></pre> <p>Our React code sets up a simple React application with a single component App. It renders a<code><div></code>element with the text <code>Hello, esbuild! </code>and mounts it into the DOM, specifically into the element with the <code>id </code>of <code>root</code>.</p> <h2>How to Create the Build Function</h2> <p>Let's add the following build script using the <code>esbuild </code>bundler in our <code>package.json </code>file:</p> <pre><code>"scripts": { "build": "esbuild src/index.js --bundle --outfile=Bundle.js --loader:.js=jsx --format=cjs" }, </code></pre> <p>This build script starts with the entry point <code>src/index.js </code>and proceeds to bundle all the dependencies. The resulting bundled code is saved as <code>Bundle.js</code>.</p> <p>The script also specifies that files with the <code>.js </code>extension should be treated as <code>jsx </code>files, indicating the usage of JSX syntax.</p> <p>Finally, the output format is set to<code>CommonJS (cjs)</code>which is the module system utilized by Node.js.</p> <p>By executing this build script, the <code>esbuild </code>bundler will process the files, apply the necessary transformations, and generate a single bundled JavaScript file ready for deployment or further usage.</p> <h3>Overview of the Build Function and its Purpose</h3> <p>The build script using esbuild is JavaScript code that bundles your JavaScript code into a single file. This is useful for optimizing your code for production environments, reducing the number of HTTP requests needed to load your application, and improving load times.</p> <p>The build method takes an<code>options</code>object as its argument, which allows you to configure how your code is bundled. The options object specifies properties such as<code>entryPoints</code>,<code>outfile</code>,<code>format</code>,<code>bundle</code>, and<code>loader</code>.</p> <p>Once the build method is configured with the desired options, the build function is called, which triggers the build process. This will output a single bundled file containing all of your JavaScript code.</p> <p>Finally, the build script is run by executing the script using Node.js. You can do this by updating the<code>package.json</code>file to include a script that runs the build script, as shown above.</p> <p>Build the React app using the following command:</p> <pre><code>npm run build</code></pre> <p>Then run the app using this command:</p> <pre><code>npx http-server</code></pre> <h2></h2> </div> <div class="blog-title-area"> <div class="tag-cloud-single"> <span>Теги</span> <small><a href=" /search?tg=React" title="">#React</a></small> <small><a href=" /search?tg=Esbuild" title="">#Esbuild</a></small> <small><a href=" /search?tg=JS" title="">#JS</a></small> </div> </div> <div class="post-sharing"> <ul class="list-inline"> <li> <a href="https://www.facebook.com/sharer/sharer.php?u=https://read-it.news/it/how-to-bundle-a-simple-react-application-using-esbuild_diyCc&display=popup&display=popup&ref=plugin" class="fb-button btn btn-primary" onclick="addToDataLayer('Share_Fb','https://read-it.news/it/how-to-bundle-a-simple-react-application-using-esbuild_diyCc')" rel="nofollow noreferrer" target="_blank"> <i class="fa fa-facebook"></i> <span class="down-mobile">Поділитися у Facebook</span> </a> </li> <li><a href="https://twitter.com/intent/tweet?url=https://read-it.news/it/how-to-bundle-a-simple-react-application-using-esbuild_diyCc&via=qr" class="tw-button btn btn-primary" onclick="addToDataLayer('Share_Tw','https://read-it.news/it/how-to-bundle-a-simple-react-application-using-esbuild_diyCc')" rel="nofollow noreferrer" target="_blank" > <i class="fa fa-twitter" ></i> <span class="down-mobile">Поділитися у Twitter</span> </a> </li> <li><a href="https://www.linkedin.com/shareArticle?mini=true&url=https://read-it.news/it/how-to-bundle-a-simple-react-application-using-esbuild_diyCc" class=" btn btn-primary" style="background: #0272b1; " rel="nofollow noreferrer" target="_blank" onclick="addToDataLayer('Share_Link','https://read-it.news/it/how-to-bundle-a-simple-react-application-using-esbuild_diyCc')" ><i class="fa fa-linkedin"></i> <span class="down-mobile">Share on Linkedin</span> </a></li> </ul> </div> <div style="text-align: center; font-size: 10px;">Ресурс : <a href="https://www.freecodecamp.org/news/bundle-a-basic-react-application-using-esbuild/" target="_blank" rel="nofollow">freecodecamp.org </a></div> <hr class="invis1"> <div class="custombox clearfix"> <h3 class="small-title">Вам також може сподобатися</h3> <div class="row"> <div class="col-lg-6"> <div class="blog-box"> <div class="post-media parent " > <div class="child" > <img class="lazyload child" alt="Sharing UI Components: Copy VS Install" src="/blog/articles/k8olu/1730242325_VtkOfya2CCw_*150*_w.jpg" data-src="/blog/articles/k8olu/1730242325_VtkOfya2CC.jpg"/> <a href="/it/sharing-ui-components-copy-vs-install_k8olu" title="Sharing UI Components: Copy VS Install" aria-label="Sharing UI Components: Copy VS Install"> <div class="hovereffect"> <span class="" style=" font-family: 'Rochester', serif; font-size: 75px;font-weight: 600; color: #ffffff">R</span> </div> </a> </div> </div> <div class="blog-meta"> <h4><a href="/it/sharing-ui-components-copy-vs-install_k8olu" title="">Sharing UI Components: Copy VS Install</a></h4> <small><a href="/category/it" title="">IT</a></small> <small><a title="">29 October 2024</a></small> </div> </div> </div> <div class="col-lg-6"> <div class="blog-box"> <div class="post-media parent " > <div class="child" > <img class="lazyload child" alt="Important React Tips for Writing Cleaner, Efficient Code for Beginners" src="/blog/articles/3P1kL/1730242301_QviVppxxy2w_*150*_w.png" data-src="/blog/articles/3P1kL/1730242301_QviVppxxy2.png"/> <a href="/it/important-react-tips-for-writing-cleaner-efficient-code-for-beginners_3P1kL" title="Important React Tips for Writing Cleaner, Efficient Code for Beginners" aria-label="Important React Tips for Writing Cleaner, Efficient Code for Beginners"> <div class="hovereffect"> <span class="" style=" font-family: 'Rochester', serif; font-size: 75px;font-weight: 600; color: #ffffff">R</span> </div> </a> </div> </div> <div class="blog-meta"> <h4><a href="/it/important-react-tips-for-writing-cleaner-efficient-code-for-beginners_3P1kL" title="">Important React Tips for Writing Cleaner, Efficient Code for Beginners</a></h4> <small><a href="/category/it" title="">IT</a></small> <small><a title="">29 October 2024</a></small> </div> </div> </div> </div> </div> <hr class="invis1"> </div> </div> </div> </div><!-- end container --> </section> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/default.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"></script> <script> hljs.highlightAll(); </script> <script> window.article = "588" </script> <script type="application/ld+json"> { "@context": "http://schema.org", "@type":"Article" , "mainEntityOfPage": { "@type": "WebPage", "@id": "https://read-it.news/it/how-to-bundle-a-simple-react-application-using-esbuild_diyCc" }, "headline": "How to bundle a simple react application using esbuild", "image":"https://read-it.news/blog/articles/diyCc/1694122784_3yiAIjnJyR.jpg", "datePublished": "2023-08-22T22:15:33+0000", "dateModified": "2024-11-15T02:49:46+0000", "author": { "@type": "Person", "name": "Mr. IT-man", "url": "https://read-it.news/author/mr-it-man" }, "publisher": { "@type": "Organization", "name": "Read-It", "logo": { "@type": "ImageObject", "url": "https://read-it.news/blog/images/2022-08-27_470b6c.png" } }, "description": "Overview of how to use esbuild to bundle a basic React application.", "breadcrumb": { "@type": "BreadcrumbList", "itemListElement": [{ "@type": "ListItem", "position": 1, "item": { "@id": "https://read-it.news/", "name": "Домашня", "image": "https://read-it.news/blog/images/2022-08-27_470b6c.png" } }, { "@type": "ListItem", "position": 2, "item": { "@id": "https://read-it.news/category/it", "name": "IT", "image": "https://read-it.news/blog/images/2022-08-27_470b6c.png" } } ] } } </script> <footer class="footer"> <div class="container"> <div class="row"> <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12"> <div class="widget"> <span class="widget-title">Останні статті</span> <div class="blog-list-widget"> <div class="list-group"> <a href="/it/sharing-ui-components-copy-vs-install_k8olu" class="list-group-item list-group-item-action flex-column align-items-start"> <div class="w-100 justify-content-between"> <div class="child img-fluid float-left" style=" margin-right:15px;padding: 4px;max-width: 80px; height: 60px;background: center no-repeat;background-size: contain;" > <img class="lazyload child" alt="most rate articles 0" data-src="/blog/articles/k8olu/1730242325_VtkOfya2CCw_*150*_w.jpg" src="/blog/articles/k8olu/1730242325_VtkOfya2CCw_*150*_w.jpg" loading="lazy"/> </div> <h3 class="mb-1">Sharing UI Components: Copy VS Install</h3> <small>29 Жовтня 2024</small> </div> </a> <a href="/it/important-react-tips-for-writing-cleaner-efficient-code-for-beginners_3P1kL" class="list-group-item list-group-item-action flex-column align-items-start"> <div class="w-100 justify-content-between"> <div class="child img-fluid float-left" style=" margin-right:15px;padding: 4px;max-width: 80px; height: 60px;background: center no-repeat;background-size: contain;" > <img class="lazyload child" alt="most rate articles 1" data-src="/blog/articles/3P1kL/1730242301_QviVppxxy2w_*150*_w.png" src="/blog/articles/3P1kL/1730242301_QviVppxxy2w_*150*_w.png" loading="lazy"/> </div> <h3 class="mb-1">Important React Tips for Writing Cleaner, Efficient Code for Beginners</h3> <small>29 Жовтня 2024</small> </div> </a> <a href="/it/dsa-heap---key-questions-and-challenges_LrAen" class="list-group-item list-group-item-action flex-column align-items-start"> <div class="w-100 justify-content-between"> <div class="child img-fluid float-left" style=" margin-right:15px;padding: 4px;max-width: 80px; height: 60px;background: center no-repeat;background-size: contain;" > <img class="lazyload child" alt="most rate articles 2" data-src="/blog/articles/LrAen/1730024520_DkoHOVAGx4w_*150*_w.jpg" src="/blog/articles/LrAen/1730024520_DkoHOVAGx4w_*150*_w.jpg" loading="lazy"/> </div> <h3 class="mb-1">DSA: Heap - Key Questions and Challenges</h3> <small>27 Жовтня 2024</small> </div> </a> </div> </div> </div> </div> <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12"> <div class="widget"> <span class="widget-title"></span> <div class="blog-list-widget"> <div class="list-group"> <a href="/food/stravi-v-kazani-na-vogni-10-retceptiv-dlya-vidpochinku-na-prirodi_MgIB" class="list-group-item list-group-item-action flex-column align-items-start"> <div class="w-100 justify-content-between"> <div class="child img-fluid float-left" style="margin-right:15px;padding: 4px;max-width: 80px; height: 60px;background: center no-repeat;background-size: contain;"> <img class="lazyload child" alt="most rate articles 0" data-src="/blog/articles/2Av0g/1684312565.7017w_*150*_w.webp" src="/blog/articles/2Av0g/1684312565.7017w_*150*_w.webp" loading="lazy" /> </div> <h5 class="mb-1">Страви в казані на мангалі: рецепти для пікніка і відпочинку на природі</h5> <span class="rating"> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> </span> </div> </a> <a href="/travel/10-rechej-jaki-varto-znati-pro-palma-de-majorka" class="list-group-item list-group-item-action flex-column align-items-start"> <div class="w-100 justify-content-between"> <div class="child img-fluid float-left" style="margin-right:15px;padding: 4px;max-width: 80px; height: 60px;background: center no-repeat;background-size: contain;"> <img class="lazyload child" alt="most rate articles 1" data-src="/blog/articles/qnroQ/1679433398.9271w_*150*_w.webp" src="/blog/articles/qnroQ/1679433398.9271w_*150*_w.webp" loading="lazy" /> </div> <h5 class="mb-1">10 речей, які варто знати про Пальма-де-Майорка</h5> <span class="rating"> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> </span> </div> </a> <a href="/travel/najkrashi_rizdvyani_yarmarki_evropi_u_2022_roci_jEkZO" class="list-group-item list-group-item-action flex-column align-items-start"> <div class="w-100 justify-content-between"> <div class="child img-fluid float-left" style="margin-right:15px;padding: 4px;max-width: 80px; height: 60px;background: center no-repeat;background-size: contain;"> <img class="lazyload child" alt="most rate articles 2" data-src="/blog/articles/jEkZO/1684312499.6385w_*150*_w.webp" src="/blog/articles/jEkZO/1684312499.6385w_*150*_w.webp" loading="lazy" /> </div> <h5 class="mb-1">Найкращі різдвяні ярмарки Європи у 2022 році</h5> <span class="rating"> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> </span> </div> </a> </div> </div><!-- end blog-list --> </div><!-- end widget --> </div><!-- end col --> <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12"> <div class="widget"> <span class="widget-title">Категорії</span> <div class="link-widget"> <ul> <li><a href="/category/lifestyle">Стиль життя<span>(64)</span></a></li> <li><a href="/category/travel">Подорожі<span>(121)</span></a></li> <li><a href="/category/health">Здоров'я & Краса<span>(55)</span></a></li> <li><a href="/category/food">Їжа & Напої<span>(91)</span></a></li> <li><a href="/category/vlog">Vlog<span>(6)</span></a></li> <li><a href="/category/it">IT<span>(302)</span></a></li> <li><a href="/category/news">Hot News<span>(223)</span></a></li> </ul> </div> </div> </div> <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12"> <div class="widget"> <span class="widget-title">Про нас</span> <div class="link-widget"> <ul> <li><a href="https://www.paypal.com/donate/?hosted_button_id=EVM9ZQCX2XYUA">PayPal donate<span><i class="fa fa-paypal" aria-hidden="true"></i></span></a></li> <li><a href="https://buymeacoffee.com/read_it_news">Buy me a coffee<span><i class="fa fa-coffee" aria-hidden="true"></i></i></span></a></li> <li><a href="/contact-us">Напишіть для нас<span><i class="fa fa-user-circle-o"></i></span></a></li> <li><a href="/privacy-policy">Політика<span><i class="fa fa-user-secret"></i></span></a></li> <li><a href="/most-viewed">Тенденції<span><i class="fa fa-star"></i></span></a></li> <li><a href="/most-comment"> Гарячі теми<span><i class="fa fa-bolt"></i></span></a></li> </ul> </div> </div> </div> </div> <hr class="invis1"> <div class="row"> <div class="col-lg-8 offset-lg-2"> <div class="widget"> <div class="footer-text text-center"> <div class="" style="display: flex;flex-direction: column;align-items: center;"> <a href="/"><span style=" font-family: 'Rochester', serif; font-size: 55px;font-weight: 600; color: #000000">Read-It</span></a> <span style="font-size: 10px;line-height:40px;font-weight: 500; color: #aeaeae">MAGAZINE</span> </div> <p>Read-It це онлайн журнал про все, що покращує життя сучасної людини з активною життєвою позицією</p> <div class="social"> <a href="https://www.facebook.com/ReaditMagazine" data-toggle="tooltip" target="_blank" data-placement="bottom" rel="noindex nofollow" title="Facebook" aria-label="Facebook"><i class="fa fa-facebook"></i></a> <a href="https://t.me/read_it_travel" data-toggle="tooltip" target="_blank" data-placement="bottom" rel="noindex nofollow" title="Telegram" aria-label="Telegram"><i class="fa fa-telegram"></i></a> <a href="https://www.instagram.com/_read_it_magazine_/" data-toggle="tooltip" target="_blank" data-placement="bottom" rel="noindex nofollow" title="Instagram" aria-label="Instagram"><i class="fa fa-instagram"></i></a> </div> <hr class="invis"> <div class="newsletter-widget text-center"> <form class="form-inline form-custom-validate ajax_form_submit" method="post" action="/site/subscribe"> <input type="text" name="user_email" class="form-control validate" data-validate="email" placeholder="Введіть свою адресу електронної пошти"> <button type="submit" class="btn btn-primary">Підписатися<i class="fa fa-envelope-open-o"></i></button> </form> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-12 text-center"> <br> <div class="copyright">© Read-It.</div> </div> </div> </div> </footer> <div class="dmtop" style="overflow:hidden; ">Scroll to Top</div> </div> <link href="/b/css/font-awesome.min.css" rel="stylesheet"> <link href="/b/css/responsive.min.css" rel="stylesheet"> <link href="/b/css/colors.min.css" rel="stylesheet"> <script type="text/javascript" src="/b/js/tether.min.js"></script> <script type="text/javascript" src="/b/js/bootstrap.min.js" defer></script> <style> .btn-subscribe { width: 45%; padding: .5rem 1rem !important; color: #fff !important; font-size: 15px; font-family: sans-serif } .btn-telegram { background-color: #229dd8; } .btn-viber { background-color: #774e98; } .btn-later { background-color: #7394a8; } #social_subscribe { display: none; align-items: center; justify-content: center; background-color: rgba(0, 0, 0, 0.45); position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 100; overflow: hidden; } .close_subscribe_btn { position: absolute; left: 95%; font-size: xx-large; } .subscribe-text { text-align: center; color: #111; font-size: 23px; line-height: 25px; margin-bottom: 10px; } .btn-subscribe-container { display: flex; flex-direction: column; align-items: center; justify-content: center; } .subscribe-container { background-color: #fff; border-radius: 3px; display: flex; flex-direction: row; border: 1px solid #D2D2D2; position: relative; width: 600px; } .subscribe-form-block{ width:50%; padding: 35px 15px; background-color: #EBEDEF; } .post-media-subscribe{ width: 50%; } @media (max-width: 767px) { .subscribe-container{ flex-direction: column; } .post-media-subscribe{ height: 234px; width: 100%; } .subscribe-form-block{ width: 100%; } .close_subscribe_btn{ z-index: 120; color: #fff !important; } } @media (max-width: 575px) { .btn-subscribe-container { flex-direction: column; } .subscribe-container { width: 90%; } .close_subscribe_btn { left: 91%; } } </style> <script defer src="/b/js/cookie.min.js"></script> <div id="social_subscribe"> <div class="subscribe-container"> <div class="close_subscribe close_subscribe_btn"><i class="fa fa-times"></i></div> <div class="post-media post-media-subscribe" > <div class="child lazy" id="subscribe-sidebar-container"></div> <div class="shadoweffect" style="background: linear-gradient(0deg,rgba(0,0,0,1) 0%,rgba(0,0,0,0.1) 50%)"> <div class="shadow-desc"> <div class="blog-meta"> <h4><a id="subscribe-article-url"></a></h4> </div> </div> </div> </div> <div class="subscribe-form-block"> <div class="subscribe-text">Останні новини читайте в нашіх каналах, підпишись</div> <div class="btn-subscribe-container"> <div style="display: flex; width: 100%; flex-direction: row; justify-content: space-between;"> <a href="https://invite.viber.com/?g2=AQAiOOnHJqw2nFAz%2BImul9DUzD6Z4yBqmuiSOFowFrnQ9bPKF8QnQ1gF7S70lSJc" target="_blank" class="btn btn-primary btn-subscribe btn-viber" rel="nofollow">Viber <i class="fa fa-phone"></i></a> <a href="https://t.me/read_it_travel" target="_blank" class="btn btn-primary btn-subscribe btn-telegram" rel="nofollow">Telegram <i class="fa fa fa-telegram"></i></a> </div> <form class=" form-custom-validate ajax_form_submit popup-subscription" method="post" style="width: 100%; padding: 10px 0px" action="/site/subscribe"> <input type="text" name="user_email" class="form-control validate" style="width: 100%" data-validate="email" placeholder="Введіть свою адресу електронної пошти"> <button type="submit" class="btn btn-primary" style="width: 100%; margin-top: 15px;">Підписатися<i class="fa fa-envelope-open-o"></i></button> </form> </div> </div> </div> </div> <script> $(document).ready(function () { if (typeof($.cookie("is_social_subscribed")) == 'undefined') { setTimeout(function () { return $.ajax({ url: '/last-article', type: 'POST', dataType: 'json', success: function(data) { if (data.code == 200){ $('#subscribe-sidebar-container').css('background-image','url(https://read-it.news'+ data.result.img +')'); $('#subscribe-article-url').attr('hrefs',data.result.url); $('#subscribe-article-url').html(data.result.title); } document.getElementById("social_subscribe").style.display = 'flex'; }, error: function(data){document.getElementById("social_subscribe").style.display = 'flex';} }); }, 9000); } $('.close_subscribe').on('click',function(){ document.getElementById("social_subscribe").style.display = 'none'; $.cookie('is_social_subscribed', 'true', { expires: 15, path: '/' }); }) $('.btn-viber, .btn-telegram').on('click',function(){ document.getElementById("social_subscribe").style.display = 'none'; $.cookie('is_social_subscribed', 'true', { expires: 365, path: '/' }); }) }) </script><script> async function cirosantilli_load_scripts(script_urls) { function load(script_url) { return new Promise(function(resolve, reject) { if (cirosantilli_load_scripts.loaded.has(script_url)) { resolve(); } else { var script = document.createElement('script'); script.onload = resolve; script.src = script_url script.async = true document.head.appendChild(script); } }); } var promises = []; for (const script_url of script_urls) { promises.push(load(script_url)); } await Promise.all(promises); for (const script_url of script_urls) { cirosantilli_load_scripts.loaded.add(script_url); } } cirosantilli_load_scripts.loaded = new Set(); var scriptlist = [ '/b/js/custom.min.js', '/b/js/masonry.min.js', ]; scriptlist = [ '/b/js/custom.min.js', '/b/js/masonry.min.js', 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3375958122289829' ]; (async () => { await cirosantilli_load_scripts(scriptlist); SendEventAdverts('page_view','','Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)') })(); document.addEventListener("DOMContentLoaded", () => { var l1 = document.createElement('link'); l1.setAttribute('type',"font/woff2") l1.setAttribute('rel' ,"stylesheet") l1.setAttribute( 'href',"https://fonts.googleapis.com/css?family=Ubuntu:300,400,400i,500,700&display=swap") var l2 = document.createElement('link'); l2.setAttribute('type',"font/woff2") l2.setAttribute('rel' ,"stylesheet") l2.setAttribute( 'href',"https://fonts.googleapis.com/css?family=Ubuntu:300,400,400i,500,700&display=swap") var l3 = document.createElement('link'); l3.setAttribute('rel' ,"stylesheet") l3.setAttribute( 'href',"https://fonts.googleapis.com/css?family=Rochester:300,400,400i,500,700,900&display=swap") // var l4 = document.createElement('script'); // l4.setAttribute( 'href',"https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js"); // l4.src = "https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js"; // l4.async = true; // l4.setAttribute("data-name","BMC-Widget"); // l4.setAttribute("data-cfasync",false); // l4.setAttribute("data-id","read_it_news"); // l4.setAttribute("data-description","Support me on Buy me a coffee!"); // l4.setAttribute("data-message",""); // l4.setAttribute("data-color","#40DCA5"); // l4.setAttribute("data-position","Left"); // l4.setAttribute("data-x_margin","18"); // l4.setAttribute("data-y_margin","18"); document.getElementsByTagName('head')[0].appendChild(l1); document.getElementsByTagName('head')[0].appendChild(l2); document.getElementsByTagName('head')[0].appendChild(l3); // document.getElementsByTagName('head')[0].appendChild(l4); }); window.addEventListener('load', function() { var script = document.createElement('script'); script.src = 'https://www.googletagmanager.com/gtag/js?id=G-3FENZN2LCT'; script.async = true; // This ensures the script is loaded asynchronously document.head.appendChild(script); script.onload = function() { // Initialize Google Analytics once the script has loaded window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-3FENZN2LCT'); }; }); </script> </html>