<?xml version="1.0" encoding="utf-8" ?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:tt="http://teletype.in/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"><title>byKodya</title><author><name>byKodya</name></author><id>https://teletype.in/atom/bykodya</id><link rel="self" type="application/atom+xml" href="https://teletype.in/atom/bykodya?offset=0"></link><link rel="alternate" type="text/html" href="https://teletype.in/@bykodya?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=bykodya"></link><link rel="next" type="application/rss+xml" href="https://teletype.in/atom/bykodya?offset=10"></link><link rel="search" type="application/opensearchdescription+xml" title="Teletype" href="https://teletype.in/opensearch.xml"></link><updated>2026-04-23T06:27:56.862Z</updated><entry><id>bykodya:wCdk53bpnXX</id><link rel="alternate" type="text/html" href="https://teletype.in/@bykodya/wCdk53bpnXX?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=bykodya"></link><title>Build and Package an NPM Component with esbuild, React and TypeScript</title><published>2022-06-11T22:03:20.176Z</published><updated>2022-06-11T22:03:20.176Z</updated><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img2.teletype.in/files/18/b2/18b24747-92cb-432a-8d3c-b646ce2d1c2f.png"></media:thumbnail><summary type="html">&lt;img src=&quot;https://miro.medium.com/max/1076/1*LEPBFO7T1kY4nHoJ0FQbXQ.png&quot;&gt;Looking for a simple, straightforward, development environment for a React component(s) that can be bundled and packaged for NPM distribution? Here’s our team’s approach using esbuild, TypeScript and React.</summary><content type="html">
  &lt;p id=&quot;fff4&quot;&gt;Looking for a simple, straightforward, development environment for a React component(s) that can be bundled and packaged for NPM distribution? Here’s our team’s approach using &lt;a href=&quot;https://esbuild.github.io/&quot; target=&quot;_blank&quot;&gt;esbuild&lt;/a&gt;, &lt;a href=&quot;https://www.typescriptlang.org/&quot; target=&quot;_blank&quot;&gt;TypeScript&lt;/a&gt; and &lt;a href=&quot;https://reactjs.org/&quot; target=&quot;_blank&quot;&gt;React&lt;/a&gt;.&lt;/p&gt;
  &lt;h2 id=&quot;ccee&quot;&gt;Quick background&lt;/h2&gt;
  &lt;p id=&quot;265a&quot;&gt;Recently our dev team at &lt;a href=&quot;https://www.library.northwestern.edu/&quot; target=&quot;_blank&quot;&gt;Northwestern University Libraries&lt;/a&gt; set out to create an open-source, image, audio and video viewer component to display items from our &lt;a href=&quot;https://dc.library.northwestern.edu/&quot; target=&quot;_blank&quot;&gt;Digital Collections&lt;/a&gt; UI application.&lt;/p&gt;
  &lt;p id=&quot;16bd&quot;&gt;The requirements were:&lt;/p&gt;
  &lt;ul id=&quot;iiES&quot;&gt;
    &lt;li id=&quot;cc99&quot;&gt;Re-use the component in a variety of applications&lt;/li&gt;
    &lt;li id=&quot;c34d&quot;&gt;Establish a simple development environment (featuring live reloading, fast bundling, etc), without using extra helpers like Create React App, Next.js, etc.&lt;/li&gt;
    &lt;li id=&quot;e9cd&quot;&gt;Package for easy NPM distribution&lt;/li&gt;
    &lt;li id=&quot;8b66&quot;&gt;A public API for how to use this component via types and IntelliSense support in any IDE (via TypeScript)&lt;/li&gt;
  &lt;/ul&gt;
  &lt;p id=&quot;de59&quot;&gt;Although there are many helpful articles on varying combinations of the above technologies, we thought we’d share our particular use case.&lt;/p&gt;
  &lt;p id=&quot;6952&quot;&gt;If you’d like to jump straight to the code, here’s an example repo of the final code: &lt;a href=&quot;https://github.com/adamjarling/medium-es-build-article-demo&quot; target=&quot;_blank&quot;&gt;https://github.com/adamjarling/medium-es-build-article-demo&lt;/a&gt;.&lt;/p&gt;
  &lt;h1 id=&quot;40b7&quot;&gt;esbuild&lt;/h1&gt;
  &lt;p id=&quot;aca7&quot;&gt;&lt;a href=&quot;https://esbuild.github.io/&quot; target=&quot;_blank&quot;&gt;esbuild&lt;/a&gt; is gaining a lot of traction lately due to its simplified API, speed, native support for TypeScript and a host of other great features. It seemed a more streamlined approach so we’ll use this as our JavaScript bundler/packager.&lt;/p&gt;
  &lt;p id=&quot;dbd0&quot;&gt;It might prove helpful to reference &lt;a href=&quot;https://esbuild.github.io/api/#build-api&quot; target=&quot;_blank&quot;&gt;esbuild’s API&lt;/a&gt; when reading through this article or following the steps to set up your project in case you’d like to adjust your config.&lt;/p&gt;
  &lt;h1 id=&quot;b788&quot;&gt;Set up the project&lt;/h1&gt;
  &lt;p id=&quot;c581&quot;&gt;First, create a new directory for your project and enter the project. Let’s next initialize &lt;code&gt;npm&lt;/code&gt; and &lt;code&gt;git&lt;/code&gt; in your project to get a &lt;code&gt;package.json&lt;/code&gt; file. Go ahead and accept all the command prompt defaults for now (you can always update later).&lt;/p&gt;
  &lt;pre id=&quot;Y5ft&quot;&gt;// Create your new project directorymkdir my-awesome-projectcd my-awesome-project// Initialize npmnpm init// Initialize gitgit init&lt;/pre&gt;
  &lt;h1 id=&quot;b06e&quot;&gt;Set up the development environment&lt;/h1&gt;
  &lt;p id=&quot;9c5a&quot;&gt;Let’s get a development environment up and running. First, we’ll install some initial development dependencies:&lt;/p&gt;
  &lt;pre id=&quot;L2Me&quot;&gt;// Install development dependenciesnpm install -D esbuild typescript chokidar rimraf live-server&lt;/pre&gt;
  &lt;p id=&quot;a443&quot;&gt;&lt;strong&gt;What are we installing?&lt;/strong&gt;&lt;/p&gt;
  &lt;p id=&quot;1450&quot;&gt;&lt;code&gt;chokidar&lt;/code&gt; used to watch for changes in our code to help with live reloading.&lt;/p&gt;
  &lt;p id=&quot;42d8&quot;&gt;&lt;code&gt;rimraf&lt;/code&gt; used to clean up our output directory to ensure fresh, clean files.&lt;/p&gt;
  &lt;p id=&quot;835a&quot;&gt;&lt;code&gt;live-server&lt;/code&gt; is a lightweight local webserver we’ll use to serve the dev environment so you can see your work in a browser.&lt;/p&gt;
  &lt;p id=&quot;6649&quot;&gt;Next, we’ll install React and its types (so TypeScript knows the syntax), which is a dependency our app needs to run in the browser.&lt;/p&gt;
  &lt;pre id=&quot;NfK8&quot;&gt;npm install react react-dom @types/react @types/react-dom&lt;/pre&gt;
  &lt;h2 id=&quot;bce1&quot;&gt;Add dev environment project structure&lt;/h2&gt;
  &lt;p id=&quot;4d69&quot;&gt;Now let’s add some initial development environment files in our project. We’ll start with two boilerplate config files, &lt;code&gt;.gitignore&lt;/code&gt; and &lt;code&gt;tsconfig.json&lt;/code&gt;. Create them at the project root:&lt;/p&gt;
  &lt;pre id=&quot;ID8s&quot;&gt;touch .gitignoretouch tsconfig.json&lt;/pre&gt;
  &lt;p id=&quot;1831&quot;&gt;To get started, you can copy the contents of &lt;a href=&quot;https://github.com/adamjarling/medium-es-build-article-demo/blob/main/.gitignore&quot; target=&quot;_blank&quot;&gt;this file&lt;/a&gt; into &lt;code&gt;.gitignore&lt;/code&gt; and &lt;a href=&quot;https://github.com/adamjarling/medium-es-build-article-demo/blob/main/tsconfig.json&quot; target=&quot;_blank&quot;&gt;this file&lt;/a&gt; into your TypeScript configuration file, &lt;code&gt;tsconfig.json&lt;/code&gt;&lt;/p&gt;
  &lt;h2 id=&quot;49f6&quot;&gt;/public&lt;/h2&gt;
  &lt;p id=&quot;e42d&quot;&gt;Let’s create a directory called &lt;code&gt;/public&lt;/code&gt; which will contain files our local dev server will use.&lt;/p&gt;
  &lt;pre id=&quot;uOqN&quot;&gt;// Create dev environment filesmkdir publiccd publictouch index.html&lt;/pre&gt;
  &lt;p id=&quot;7107&quot;&gt;Copy the contents of &lt;a href=&quot;https://github.com/adamjarling/medium-es-build-article-demo/blob/main/public/index.html&quot; target=&quot;_blank&quot;&gt;this file&lt;/a&gt; into your &lt;code&gt;/public/index.html&lt;/code&gt;.&lt;/p&gt;
  &lt;figure id=&quot;6LSu&quot; class=&quot;m_custom&quot;&gt;
    &lt;iframe src=&quot;https://javascript.plainenglish.io/media/b608565f07980497946939798169921d&quot;&gt;&lt;/iframe&gt;
    &lt;figcaption&gt;index.html&lt;/figcaption&gt;
  &lt;/figure&gt;
  &lt;p id=&quot;1349&quot;&gt;&lt;code&gt;&amp;lt;div id=&amp;quot;root&amp;quot; /&amp;gt;&lt;/code&gt;is the HTML element to which our React component will attach. And &lt;code&gt;&amp;lt;script src=&amp;quot;/script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;is where our bundled dev code needs to end up to render in the browser.&lt;/p&gt;
  &lt;h2 id=&quot;8e6e&quot;&gt;/src&lt;/h2&gt;
  &lt;p id=&quot;e92b&quot;&gt;Now let’s mimic what a consuming app and our component to be imported will look like in our development environment. Let’s create 2 files, one of which, &lt;code&gt;dev.tsx&lt;/code&gt; mimics a consuming app and the other, &lt;code&gt;index.tsx&lt;/code&gt; which will represent our top-level component consuming apps will import.&lt;/p&gt;
  &lt;p id=&quot;ccb2&quot;&gt;First, back out to the root of our project, and create a sibling &lt;code&gt;/src&lt;/code&gt; directory next to &lt;code&gt;/public&lt;/code&gt;.&lt;/p&gt;
  &lt;pre id=&quot;HNSC&quot;&gt;mkdir srccd srctouch dev.tsxtouch index.tsx&lt;/pre&gt;
  &lt;p id=&quot;7bb1&quot;&gt;Your project should now look like this:&lt;/p&gt;
  &lt;figure id=&quot;t9JG&quot; class=&quot;m_custom&quot;&gt;
    &lt;img src=&quot;https://miro.medium.com/max/1076/1*LEPBFO7T1kY4nHoJ0FQbXQ.png&quot; width=&quot;538&quot; /&gt;
  &lt;/figure&gt;
  &lt;p id=&quot;d58d&quot;&gt;In &lt;code&gt;/src/dev.tsx&lt;/code&gt;, copy the contents of &lt;a href=&quot;https://github.com/adamjarling/medium-es-build-article-demo/blob/main/src/dev.tsx&quot; target=&quot;_blank&quot;&gt;this file&lt;/a&gt;:&lt;/p&gt;
  &lt;figure id=&quot;8bel&quot; class=&quot;m_custom&quot;&gt;
    &lt;iframe src=&quot;https://javascript.plainenglish.io/media/9378804a54bf0bb736397832838814cd&quot;&gt;&lt;/iframe&gt;
    &lt;figcaption&gt;dev.tsx&lt;/figcaption&gt;
  &lt;/figure&gt;
  &lt;p id=&quot;8a23&quot;&gt;And in &lt;code&gt;/src/index.tsx&lt;/code&gt;, copy the contents of &lt;a href=&quot;https://github.com/adamjarling/medium-es-build-article-demo/blob/main/src/index.tsx&quot; target=&quot;_blank&quot;&gt;this file&lt;/a&gt;:&lt;/p&gt;
  &lt;figure id=&quot;xyyo&quot; class=&quot;m_custom&quot;&gt;
    &lt;iframe src=&quot;https://javascript.plainenglish.io/media/9357cb525ed8dbcffda205d3e9d56f9e&quot;&gt;&lt;/iframe&gt;
    &lt;figcaption&gt;index.tsx&lt;/figcaption&gt;
  &lt;/figure&gt;
  &lt;h2 id=&quot;ad6b&quot;&gt;Bundle up the code and render in a browser&lt;/h2&gt;
  &lt;p id=&quot;3f5c&quot;&gt;Now we’ll create a file &lt;code&gt;/src/serve.js&lt;/code&gt; that will contain the config for our dev environment. This file will watch for changes in our code, bundle up our code for the browser, and provide a live reload experience.&lt;/p&gt;
  &lt;pre id=&quot;JUyi&quot;&gt;// /src/serve.jstouch serve.js&lt;/pre&gt;
  &lt;p id=&quot;f933&quot;&gt;Copy the contents of &lt;a href=&quot;https://github.com/adamjarling/medium-es-build-article-demo/blob/main/serve.js&quot; target=&quot;_blank&quot;&gt;this file&lt;/a&gt; into &lt;code&gt;src/serve.js&lt;/code&gt;&lt;/p&gt;
  &lt;figure id=&quot;GMAs&quot; class=&quot;m_custom&quot;&gt;
    &lt;iframe src=&quot;https://javascript.plainenglish.io/media/809c58d7e3d473b6d7939c9b75fcb355&quot;&gt;&lt;/iframe&gt;
    &lt;figcaption&gt;serve.js&lt;/figcaption&gt;
  &lt;/figure&gt;
  &lt;p id=&quot;7c2f&quot;&gt;There’s a lot going on here, but if you read through the code the primary takeaways are:&lt;/p&gt;
  &lt;ul id=&quot;7U9P&quot;&gt;
    &lt;li id=&quot;5cb6&quot;&gt;esbuild’s &lt;code&gt;build&lt;/code&gt; method is bundling our code with some basic configuration applied, and creating the &lt;code&gt;/public/script.js&lt;/code&gt; file as it’s output.&lt;/li&gt;
    &lt;li id=&quot;e2bf&quot;&gt;&lt;code&gt;chokidar&lt;/code&gt; is watching for changes to any TypeScript files, and then we’re telling esbuild to re-build.&lt;/li&gt;
    &lt;li id=&quot;f2fd&quot;&gt;&lt;code&gt;live-server&lt;/code&gt; is starting up a local web server with some basic configuration.&lt;/li&gt;
  &lt;/ul&gt;
  &lt;p id=&quot;943d&quot;&gt;Now let’s create a script so we can run the code and try it out.&lt;/p&gt;
  &lt;h2 id=&quot;66c0&quot;&gt;npm run dev&lt;/h2&gt;
  &lt;p id=&quot;47c0&quot;&gt;We’ll need to update our &lt;code&gt;package.json&lt;/code&gt; file to add a &lt;code&gt;npm run dev&lt;/code&gt; command we can run to verify everything is working. Replace the &lt;code&gt;scripts&lt;/code&gt; key in our &lt;code&gt;package.json&lt;/code&gt; file to match the following:&lt;/p&gt;
  &lt;pre id=&quot;3rNx&quot;&gt;// package.json...&amp;quot;scripts&amp;quot;: {  &amp;quot;dev&amp;quot;: &amp;quot;node serve.js&amp;quot;},&lt;/pre&gt;
  &lt;p id=&quot;d6c8&quot;&gt;Now run:&lt;/p&gt;
  &lt;pre id=&quot;MecA&quot;&gt;npm run dev&lt;/pre&gt;
  &lt;p id=&quot;4049&quot;&gt;in your terminal and you’ll see a new browser window or tab open up. Make some changes to your code and notice live-reload should be working as well.&lt;/p&gt;
  &lt;figure id=&quot;k4EA&quot; class=&quot;m_custom&quot;&gt;
    &lt;img src=&quot;https://miro.medium.com/max/1400/1*LB28o3FT2FHevw0ziwmOQQ.png&quot; width=&quot;700&quot; /&gt;
    &lt;figcaption&gt;Screen shot of local app running. Not too exciting but proves the point&lt;/figcaption&gt;
  &lt;/figure&gt;
  &lt;p id=&quot;3ea9&quot;&gt;At this point, you can add as many components as you like to your app, make it as simple or complex as you like, but keep &lt;code&gt;index.tsx&lt;/code&gt; as your top-level component which imports all other child components.&lt;/p&gt;
  &lt;h1 id=&quot;b020&quot;&gt;Set up the production build environment&lt;/h1&gt;
  &lt;p id=&quot;2565&quot;&gt;We now have a minimal development environment up and running. You’ll likely want to add unit tests, linters and other project best practices at this point, so feel free to explore and build out your app. We can cover this more in detail of tools our teams use in another article if anyone’s interested.&lt;/p&gt;
  &lt;h2 id=&quot;fe6b&quot;&gt;build.js&lt;/h2&gt;
  &lt;p id=&quot;2a8f&quot;&gt;Let’s add another file which uses esbuild’s &lt;code&gt;build&lt;/code&gt; method to bundle up our component for importing into other React projects, and prepare for distribution to NPM.&lt;/p&gt;
  &lt;p id=&quot;efca&quot;&gt;Create a &lt;code&gt;/build.js&lt;/code&gt; file in the project root:&lt;/p&gt;
  &lt;pre id=&quot;Mk0P&quot;&gt;// build.jstouch build.js// The project structure should look like...build.jsserve.jssrc/  ...&lt;/pre&gt;
  &lt;p id=&quot;f8da&quot;&gt;Copy the contents of &lt;a href=&quot;https://github.com/adamjarling/medium-es-build-article-demo/blob/main/build.js&quot; target=&quot;_blank&quot;&gt;this file&lt;/a&gt; into &lt;code&gt;/build.js&lt;/code&gt; .&lt;/p&gt;
  &lt;figure id=&quot;TPvC&quot; class=&quot;m_custom&quot;&gt;
    &lt;iframe src=&quot;https://javascript.plainenglish.io/media/4bc3616c91bf9e52408e2d33ce6ed4ca&quot;&gt;&lt;/iframe&gt;
    &lt;figcaption&gt;build.js&lt;/figcaption&gt;
  &lt;/figure&gt;
  &lt;p id=&quot;cd36&quot;&gt;In this configuration file, we’re defining our entry file &lt;code&gt;/src/index.tsx&lt;/code&gt; and two output file formats: ESModules and CommonJS into a project &lt;code&gt;dist&lt;/code&gt; folder as the final destination for our packaged component’s code.&lt;/p&gt;
  &lt;p id=&quot;c4b9&quot;&gt;Typically most browser-based apps will consume the &lt;code&gt;esm&lt;/code&gt; format and Node environment apps the &lt;code&gt;cjs&lt;/code&gt; format, but since we don’t know for certain what type of bundlers consuming apps will be using, we’ll provide both formats.&lt;/p&gt;
  &lt;p id=&quot;7871&quot;&gt;Now let’s hop back to the &lt;code&gt;package.json&lt;/code&gt; file and finish wiring things up.&lt;/p&gt;
  &lt;p id=&quot;6013&quot;&gt;Here are &lt;a href=&quot;https://github.com/adamjarling/medium-es-build-article-demo/commit/670831d4e1afef215bdfc873f9c6e0d1fbb78fef#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519&quot; target=&quot;_blank&quot;&gt;the diffs we’re going to add&lt;/a&gt; to our &lt;code&gt;package.json&lt;/code&gt; file. The latest file will look like this:&lt;/p&gt;
  &lt;figure id=&quot;VL9D&quot; class=&quot;m_custom&quot;&gt;
    &lt;iframe src=&quot;https://javascript.plainenglish.io/media/8753cb884b0ae8fada85d954b85e7e54&quot;&gt;&lt;/iframe&gt;
    &lt;figcaption&gt;package.json&lt;/figcaption&gt;
  &lt;/figure&gt;
  &lt;p id=&quot;a550&quot;&gt;Here’s what’s added:&lt;/p&gt;
  &lt;ul id=&quot;B5XT&quot;&gt;
    &lt;li id=&quot;23a6&quot;&gt;&lt;code&gt;main&lt;/code&gt; Common JS format location for final bundled files.&lt;/li&gt;
    &lt;li id=&quot;c66a&quot;&gt;&lt;code&gt;module&lt;/code&gt; ES modules format location for final bundle files.&lt;/li&gt;
    &lt;li id=&quot;3dbc&quot;&gt;&lt;code&gt;scripts.build&lt;/code&gt; This command cleans out the &lt;code&gt;/dist&lt;/code&gt; directory, then executes our ESBuild via the &lt;code&gt;build.js&lt;/code&gt; file. This command also creates Typescript type definitions which are exported with our final bundled files so IDEs will get IntelliSense and autocomplete for our exported component.&lt;/li&gt;
    &lt;li id=&quot;1d85&quot;&gt;&lt;code&gt;scripts.clean&lt;/code&gt; Cleans out the &lt;code&gt;dist&lt;/code&gt; folder of any leftover debris.&lt;/li&gt;
    &lt;li id=&quot;be11&quot;&gt;&lt;code&gt;scripts.prepublishOnly&lt;/code&gt; This ensures that every time you do an &lt;code&gt;npm publish&lt;/code&gt; the &lt;code&gt;build.js&lt;/code&gt; command gets executed. Otherwise, you’ll have to manually build your new production files each time before publishing, and it’s easy to forget:)&lt;/li&gt;
    &lt;li id=&quot;4887&quot;&gt;&lt;code&gt;files&lt;/code&gt; Tells NPM to only package up files in this array of project directories&lt;/li&gt;
  &lt;/ul&gt;
  &lt;h2 id=&quot;f1ee&quot;&gt;Build the package&lt;/h2&gt;
  &lt;p id=&quot;705b&quot;&gt;We’re now ready to build the package:&lt;/p&gt;
  &lt;pre id=&quot;DxwL&quot;&gt;npm run build&lt;/pre&gt;
  &lt;p id=&quot;9914&quot;&gt;We’ll now see a new &lt;code&gt;/dist&lt;/code&gt; directory has been created and its contents should look like this:&lt;/p&gt;
  &lt;figure id=&quot;hDNz&quot; class=&quot;m_custom&quot;&gt;
    &lt;img src=&quot;https://miro.medium.com/max/1116/1*As6BS0IHj15QrqbwnE_KaA.png&quot; width=&quot;558&quot; /&gt;
  &lt;/figure&gt;
  &lt;h1 id=&quot;63ee&quot;&gt;Test locally&lt;/h1&gt;
  &lt;p id=&quot;d593&quot;&gt;To test that our component actually exports and imports successfully, open up any React project in your local environment, and import this component directly from a local file path. Here’s an example:&lt;/p&gt;
  &lt;pre id=&quot;hLIB&quot;&gt;// Install the local packagenpm install &amp;#x27;../location/of/your/local/project&amp;#x27;;&lt;/pre&gt;
  &lt;p id=&quot;e1a4&quot;&gt;Import the component into a local React app:&lt;/p&gt;
  &lt;pre id=&quot;oqTw&quot;&gt;// Some other React appimport MyAwesomeComponent from &amp;#x27;my-awesome-project&amp;#x27;;...&lt;/pre&gt;
  &lt;section&gt;
    &lt;pre id=&quot;H57l&quot;&gt;&amp;lt;MyAwesomeComponent foo=&amp;quot;something goes here&amp;quot; /&amp;gt;&lt;/pre&gt;
    &lt;h1 id=&quot;f6ca&quot;&gt;Publish to NPM&lt;/h1&gt;
    &lt;p id=&quot;912a&quot;&gt;Congratulations, you know have a project ready to deliver to NPM! There’s plenty of articles on &lt;a href=&quot;https://docs.npmjs.com/about-packages-and-modules&quot; target=&quot;_blank&quot;&gt;how to publish packages to NPM&lt;/a&gt;, so explore the NPM docs for more details, but in it’s most basic form it’s as simple as:&lt;/p&gt;
    &lt;pre id=&quot;9rrs&quot;&gt;npm publish&lt;/pre&gt;
    &lt;h1 id=&quot;c204&quot;&gt;Articles / References&lt;/h1&gt;
    &lt;p id=&quot;9b49&quot;&gt;Thanks to the following for some great patterns and references we used to build our config:&lt;/p&gt;
    &lt;ul id=&quot;6PJm&quot;&gt;
      &lt;li id=&quot;ac7c&quot;&gt;&lt;a href=&quot;https://github.com/souporserious/bundling-typescript-with-esbuild-for-npm&quot; target=&quot;_blank&quot;&gt;https://github.com/souporserious/bundling-typescript-with-esbuild-for-npm&lt;/a&gt;&lt;/li&gt;
      &lt;li id=&quot;e596&quot;&gt;&lt;a href=&quot;https://github.com/zaydek/esbuild-hot-reload&quot; target=&quot;_blank&quot;&gt;https://github.com/zaydek/esbuild-hot-reload&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;p id=&quot;7d1f&quot;&gt;&lt;em&gt;More content at &lt;a href=&quot;http://plainenglish.io/&quot; target=&quot;_blank&quot;&gt;plainenglish.io&lt;/a&gt;. Sign up for our &lt;a href=&quot;http://newsletter.plainenglish.io/&quot; target=&quot;_blank&quot;&gt;free weekly newsletter&lt;/a&gt;. Get exclusive access to writing opportunities and advice in our &lt;a href=&quot;https://discord.gg/GtDtUAvyhW&quot; target=&quot;_blank&quot;&gt;community Discord&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
  &lt;/section&gt;
  &lt;h2 id=&quot;lW7J&quot;&gt;Get an email whenever Adam J. Arling publishes.&lt;/h2&gt;
  &lt;h2 id=&quot;aOPA&quot;&gt;&lt;a href=&quot;https://javascript.plainenglish.io/?source=post_page-----3eb756adda6e--------------------------------&quot; target=&quot;_blank&quot;&gt;More from JavaScript in Plain English&lt;/a&gt;&lt;/h2&gt;
  &lt;p id=&quot;VC6J&quot;&gt;&lt;a href=&quot;https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fsubscribe%2Fcollection%2Fjavascript-in-plain-english%2F3eb756adda6e&amp;operation=register&amp;redirect=https%3A%2F%2Fjavascript.plainenglish.io%2Fdevelop-and-publish-a-react-component-with-esbuild-and-typescript-3eb756adda6e&amp;collection=JavaScript+in+Plain+English&amp;collectionId=4b3a1ed4f11c&amp;source=post_page-----3eb756adda6e---------------------follow_footer-----------&quot; target=&quot;_blank&quot;&gt;Follow&lt;/a&gt;&lt;/p&gt;
  &lt;p id=&quot;d4dr&quot;&gt;New JavaScript and Web Development content every day. Follow to join 2.5M+ monthly readers.&lt;/p&gt;
  &lt;p id=&quot;u5PG&quot;&gt;&lt;a href=&quot;https://medium.com/@kyledeguzmanx?source=post_page-----3eb756adda6e----0----------------------------&quot; target=&quot;_blank&quot;&gt;Kyle DeGuzman&lt;/a&gt;&lt;/p&gt;
  &lt;p id=&quot;lP2C&quot;&gt;&lt;a href=&quot;https://javascript.plainenglish.io/want-to-understand-immediately-invoked-function-expressions-you-can-start-now-9afb9dc460c8?source=post_page-----3eb756adda6e----0----------------------------&quot; target=&quot;_blank&quot;&gt;·Jan 4&lt;/a&gt;&lt;/p&gt;
  &lt;p id=&quot;5KDj&quot;&gt;&lt;a href=&quot;https://javascript.plainenglish.io/want-to-understand-immediately-invoked-function-expressions-you-can-start-now-9afb9dc460c8?source=post_page-----3eb756adda6e----0----------------------------&quot; target=&quot;_blank&quot;&gt;Want to Understand Immediately Invoked Function Expressions (IIFEs)? You Can Start NowJavascript Has Three Types of Functions: Named, Annonymous, and IIFE. Do you know the difference? — Immediately Invoked Function Expressions, or IIFE, are exactly what the name suggests. They are functions that are immediately called as soon as you define them. Take the following sample code:&lt;/a&gt;&lt;/p&gt;
  &lt;p id=&quot;9CFd&quot;&gt;&lt;a href=&quot;https://medium.com/tag/javascript?source=post_page-----3eb756adda6e---------------javascript-----------------&quot; target=&quot;_blank&quot;&gt;Java Script&lt;/a&gt;&lt;/p&gt;
  &lt;p id=&quot;QviV&quot;&gt;&lt;a href=&quot;https://javascript.plainenglish.io/want-to-understand-immediately-invoked-function-expressions-you-can-start-now-9afb9dc460c8?source=post_page-----3eb756adda6e----0----------------------------&quot; target=&quot;_blank&quot;&gt;4 min read&lt;/a&gt;&lt;/p&gt;
  &lt;hr /&gt;
  &lt;p id=&quot;t2lp&quot;&gt;&lt;a href=&quot;https://sachin-chaurasiya.medium.com/?source=post_page-----3eb756adda6e----1----------------------------&quot; target=&quot;_blank&quot;&gt;Sachin chaurasiya&lt;/a&gt;&lt;/p&gt;
  &lt;p id=&quot;EwdL&quot;&gt;&lt;a href=&quot;https://javascript.plainenglish.io/the-simple-guide-to-seo-for-your-application-d0ee2d313a05?source=post_page-----3eb756adda6e----1----------------------------&quot; target=&quot;_blank&quot;&gt;·Jan 3&lt;/a&gt;&lt;/p&gt;
  &lt;p id=&quot;4ekb&quot;&gt;&lt;a href=&quot;https://javascript.plainenglish.io/the-simple-guide-to-seo-for-your-application-d0ee2d313a05?source=post_page-----3eb756adda6e----1----------------------------&quot; target=&quot;_blank&quot;&gt;The Simple Guide to SEO for Your ApplicationSome basic SEO setups that we can do ourselves as a developer without relying on SEO experts. — We as a developer mostly focused on solving problems and building stuff. but some other things need our focus and time. SEO(Search Engine Optimization) is one of them, and we can’t say that it’s not a developer job it’s some SEO expert job. There are many things when we talk…&lt;/a&gt;&lt;/p&gt;
  &lt;p id=&quot;fWvB&quot;&gt;&lt;a href=&quot;https://medium.com/tag/seo?source=post_page-----3eb756adda6e---------------seo-----------------&quot; target=&quot;_blank&quot;&gt;SEO&lt;/a&gt;&lt;/p&gt;
  &lt;p id=&quot;sjMC&quot;&gt;&lt;a href=&quot;https://javascript.plainenglish.io/the-simple-guide-to-seo-for-your-application-d0ee2d313a05?source=post_page-----3eb756adda6e----1----------------------------&quot; target=&quot;_blank&quot;&gt;4 min read&lt;/a&gt;&lt;/p&gt;

</content></entry><entry><id>bykodya:SkV1MJE0B</id><link rel="alternate" type="text/html" href="https://teletype.in/@bykodya/SkV1MJE0B?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=bykodya"></link><title>Dasturlashni qaysi tildan boshlash kerak?</title><published>2019-12-15T16:39:55.650Z</published><updated>2019-12-15T16:39:55.650Z</updated><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://teletype.in/files/3b/3b187500-cf5a-4e7c-869c-636f7dba4fbc.jpeg"></media:thumbnail><summary type="html">&lt;img src=&quot;https://teletype.in/files/3b/3b187500-cf5a-4e7c-869c-636f7dba4fbc.jpeg&quot;&gt;Dasturchilar orasida qaysi dasturlash tilini birinchi o'rganish kerakligi haqida ko'p munozaralar bor. Bir tilidan ikkinchisiga sakramaslik uchun, dasturchilik faoliyatida qanday vazifalarni yechish istagi borligini aniqlab olish lozim. </summary><content type="html">
  &lt;figure class=&quot;m_original&quot;&gt;
    &lt;img src=&quot;https://teletype.in/files/3b/3b187500-cf5a-4e7c-869c-636f7dba4fbc.jpeg&quot; width=&quot;1200&quot; /&gt;
  &lt;/figure&gt;
  &lt;p&gt;Dasturchilar orasida qaysi dasturlash tilini birinchi o&amp;#x27;rganish kerakligi haqida ko&amp;#x27;p munozaralar bor. Bir tilidan ikkinchisiga sakramaslik uchun, dasturchilik faoliyatida qanday vazifalarni yechish istagi borligini aniqlab olish lozim. &lt;/p&gt;
  &lt;p&gt;Tavsiya etilgan tillar orasida Ruby on Rails, Java, PHP, Python, JavaScript kabilar bor. Ba&amp;#x27;zilar C ++ yoki GO bilan boshlashni maslahat berishadi. Men birinchi til sifatida - Python tilini tavsiya qilaman, lekin universitetimizda hali hamon C++ tilini o&amp;#x27;rganishga majbur qilishadi.&lt;/p&gt;
  &lt;p&gt;Pythonni tushunishni boshlash uchun - ingliz tilini bilish kifoya. Python tili ko&amp;#x27;plab Amerika kollejlarida birinchi dasturlash tili sifatida o&amp;#x27;qitiladi.&lt;/p&gt;
  &lt;p&gt;Amerika Qo&amp;#x27;shma Shtatlaridagi 39 ta yetakchi IT fakultetlari o&amp;#x27;rtasida o&amp;#x27;tkazilgan so&amp;#x27;rov natijalariga ko&amp;#x27;ra, Python, Javani ortda qoldirib, yangi dasturchilar e&amp;#x27;tiborini jalb qiladigan - birinchi, umumiy maqsadli dasturlash tiliga aylandi. Sonlar bilan aytganda, 39 ta fakultetlardan 27 tasida dasturchilik kasbini o&amp;#x27;rganishning dastlabki bosqichlarida, Python tilini - birinchi til sifatida o&amp;#x27;rgatishadi.&lt;/p&gt;
  &lt;h2&gt;Buning sabablarini ko&amp;#x27;rib chiqamiz&lt;/h2&gt;
  &lt;p&gt;&lt;strong&gt;Oson o&amp;#x27;rnatilishi&lt;/strong&gt;&lt;/p&gt;
  &lt;p&gt;Pythonda ishlashni boshlash qanchalik osonligini tushunish uchun, uni o&amp;#x27;rganishni hoziroq boshlashga harakat qilamiz. &lt;/p&gt;
  &lt;p&gt;Agar siz Mac yoki Linuxda ishlayotgan bo&amp;#x27;lsangiz terminalni oching, Windowsda bo&amp;#x27;lsangiz esa PowerShell. Bundan keyin, matnli buyruqlarni kiritish uchun bo&amp;#x27;sh oynani ko&amp;#x27;rasiz. Bu oynaga &amp;quot;python&amp;quot; so&amp;#x27;zini kiriting va Enter tugmasini bosing. Bosganingizdan keyin, quyidagi oynani ko&amp;#x27;rasiz:&lt;/p&gt;
  &lt;figure class=&quot;m_original&quot;&gt;
    &lt;img src=&quot;https://teletype.in/files/db/e2/dbe2c505-2d5e-4f14-b7c2-2f602fe38484.png&quot; width=&quot;828&quot; /&gt;
  &lt;/figure&gt;
  &lt;p&gt;Agar bu oyna ochilmasa va &amp;quot;Python&amp;quot; ichki dastur emasligi yoki shunga o&amp;#x27;xshash yozuv ko&amp;#x27;rinsa, &lt;a href=&quot;https://www.python.org/&quot; target=&quot;_blank&quot;&gt;Python&lt;/a&gt;ni o&amp;#x27;rnatishingiz kerak bo&amp;#x27;ladi.&lt;/p&gt;
  &lt;p&gt;Qanday bo&amp;#x27;lmasin, Pythonni ishga tushirish uchun bitta so&amp;#x27;z kifoya. Bundan soddaroq ish yo&amp;#x27;q.&lt;/p&gt;
  &lt;h2&gt;Python sintaksisi oddiy ingliz tilidan iborat&lt;/h2&gt;
  &lt;p&gt;Python juda sodda, shuning uchun biz birinchi dasturimizni hoziroq yarata olamiz.&lt;/p&gt;
  &lt;p&gt;Agar Python allaqachon ishlayotgan bo&amp;#x27;lsa, Mac-dagi CTRL-Z tugmachasini bosing yoki kompyuterda joriy seansni tugatish uchun &amp;quot;quit ()&amp;quot; yozing.&lt;/p&gt;
  &lt;figure class=&quot;m_original&quot;&gt;
    &lt;img src=&quot;https://teletype.in/files/a5/5f/a55fcf77-a8cc-422a-83a6-97e2c3cc7c8b.png&quot; width=&quot;899&quot; /&gt;
  &lt;/figure&gt;
  &lt;p&gt;Eng oddiy dasturdan boshlaylik: qora ekranda &amp;quot;Hello World!&amp;quot; so&amp;#x27;zlarini chiqaramiz. Keyin esa, Java va C tillarida yozilgan shunga o&amp;#x27;xshash dasturlarni taqqoslaymiz, ular bir nechta satrli kodlardan iboratligini ko&amp;#x27;rasiz. Pythonda esa murakkab sintaksis va yashirin o&amp;#x27;zgaruvchilar yo&amp;#x27;q.&lt;/p&gt;
  &lt;h2&gt;Pythonni o&amp;#x27;rganish juda oson&lt;/h2&gt;
  &lt;p&gt;Pythonda sarlavhalar va ortiqcha kodlar yo&amp;#x27;q, siz oddiy inglizcha jumlalar va so&amp;#x27;zlarning tarjimasini bilib, dasturlashdagi ba&amp;#x27;zi murakkab tushunchalarni o&amp;#x27;rganishingiz mumkin. Hozir biz eng oddiy dasturni tuzdik. Ammo ushbu maqolani o&amp;#x27;qib chiqib, Pythonda ozmuncha tushuncha paydo bo&amp;#x27;lgandan so&amp;#x27;ng, siz bu dasturni maqsadini ayta olasiz. &lt;/p&gt;
  &lt;figure class=&quot;m_original&quot;&gt;
    &lt;img src=&quot;https://teletype.in/files/d9/f4/d9f4009a-dc55-421b-bb09-3655e61bd0b1.png&quot; width=&quot;785&quot; /&gt;
  &lt;/figure&gt;
  &lt;p&gt;Men dasturni kodini yozish uchun Atom muharriridan foydalanaman.&lt;/p&gt;
  &lt;figure class=&quot;m_original&quot;&gt;
    &lt;img src=&quot;https://teletype.in/files/63/8e/638e3fa3-e0aa-4208-868c-603e760381f1.png&quot; width=&quot;695&quot; /&gt;
  &lt;/figure&gt;
  &lt;p&gt;Albatta, dastur bugungi kunda Pythonni o&amp;#x27;rganish uchun qancha talaba va o&amp;#x27;qituvchilar kelganligini hisoblab chiqadi va oddiy bo&amp;#x27;linish operatsiyasini bajaradi. Siz ham ilg&amp;#x27;adizmi?&lt;/p&gt;
  &lt;p&gt;Mana shu va boshqa sabablari uchun ham men shu tilni afzal bilaman. Ko&amp;#x27;plab Amerika universitetlari aynan shu sabablarga ko&amp;#x27;ra Pythonni tanlaydilar.&lt;/p&gt;

</content></entry></feed>