Webpack 5 and Typescript Project Setup Walkthrough

Поделиться
HTML-код
  • Опубликовано: 24 янв 2025

Комментарии • 75

  • @k4qdex
    @k4qdex 2 года назад +2

    jesus teaching us typescript. what a time to be alive

  • @matejbeber8892
    @matejbeber8892 4 года назад +17

    there is only one kind of approach: "just do it, and see if it produces an error" , its so true ... great video

  • @lyubenhorozov3293
    @lyubenhorozov3293 2 года назад +1

    Please, please, please never stop making content! Thank you!

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  2 года назад

      Happy to help. I've been super busy with a work project but I plan on starting back up with more consistent videos next month.

    • @lyubenhorozov3293
      @lyubenhorozov3293 2 года назад

      @@SwashbucklingwithCode Think about some subscription based content (like givemeacoffee, patreon etc). I'm fine giving you some dollars every month to learn consistently from you.

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  2 года назад

      @@lyubenhorozov3293 Thank you, I shall consider it.

  • @peterhirt991
    @peterhirt991 2 года назад

    Excellent way to explain how to do things step by step!!!

  • @ChaiPark
    @ChaiPark 2 года назад

    This is the best video so far to learn about the Webpack setup for TypeScript! Thank you so much!

  • @shaunhayward
    @shaunhayward 2 года назад +1

    Brilliant tutorial. I love your TDD approach

  • @gayunlee8862
    @gayunlee8862 2 года назад

    This is the best video about webpack and typescript setting. I've been looking for this! Thanks a lot :)

  • @top6tamil285
    @top6tamil285 3 года назад +1

    loved the way you show the errors and teach

  • @gerompauel
    @gerompauel 2 года назад +3

    This is an extremely useful video! Tons of gratitude to the author!

  • @AnthonyFinix
    @AnthonyFinix 2 года назад

    Man your intro is soooooo cool. love it

  • @RDWize
    @RDWize 4 года назад +1

    Thanks allot for this. I knew allot of the config already from the docs, but seeing someone going through it really helps solidify the concepts.

  • @raymonweave7157
    @raymonweave7157 4 года назад +1

    Pretty well explained, simple to understand, and step by step. Like the TDD approach as well, keep up the vids!

  • @Maxwellpaulwall
    @Maxwellpaulwall 3 года назад +1

    this channel is dope. hope you keep making videos, great content!

  • @niclasaiken9142
    @niclasaiken9142 4 года назад +2

    Really enjoyed watching this, gave a great overview! Keep it up!

  • @hollowwolf88
    @hollowwolf88 3 года назад +1

    Such a good video, thanks maaaaane!

  • @timurakhalaya6289
    @timurakhalaya6289 3 года назад

    keep on what you doing man , good work

  • @seanjones4528
    @seanjones4528 4 года назад +1

    Awesome Learning!!!!! Keep up the Great Videos!

  • @kristinarassoshenko735
    @kristinarassoshenko735 3 года назад +1

    Great! Thank you! I wish you many subscribers!

  • @a_m_dev
    @a_m_dev 3 года назад +1

    0:58 -D is for --save-dev for npm, its --dev for yarn

  • @hyfydistro
    @hyfydistro 3 года назад

    I'm here because the company I will work for require I learn TypeScript. I didn't think I'd have to touch it till now. I think I like it. Although, I'm trying to set it up with Eslint, Pettier and React... and it's a rope in a twist!

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  3 года назад +1

      TS is growing at a rapid pace. I'd have more videos on it now if I was more confident in the setups I've tried.
      I have solved the Eslint + Prettier + React many times so that's probably something I should work into a video.

  • @bilich7651
    @bilich7651 3 года назад +2

    I have to say it, I just watched your video and it's a really good content, you explain really well

  • @sukhsingh7057
    @sukhsingh7057 4 года назад +1

    Love your videos.. do you recommend using the Babel typescript loader?

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  4 года назад

      I don't know enough to have an opinion on it, I've only used it once as an alternative to this setup. It seems like the way the TS team might want to move forward, but it does seem to work a bit differently when it comes to compiling.

  • @bakaleisanich
    @bakaleisanich 4 года назад +1

    Thank you ☺️

  • @ajdinzutic
    @ajdinzutic 3 года назад

    Thank you so much for that! Can you please create a webpack 5 series and what kind of unit tests do you use?

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  3 года назад +1

      I imagine you've discovered this by now but I do indeed have a webpack 5 playlist, and some videos on testing.
      The ones I don't have videos on, but use, are Cypress and Testing Library.

    • @ajdinzutic
      @ajdinzutic 3 года назад +1

      @@SwashbucklingwithCode wow thanks a lot! just what i needed. Thank you so much for your time and effort. Do you also got documentation solution like UML / flowchart in VS Code itself? And what are your vs code plugins?

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  3 года назад

      @@ajdinzutic I don't do any flowcharting in VSCode but have seen a couple cool plugins some time back.
      I switch my VSCode plugins all the time, I don't really have a set list. Some of the ones I always use are: prettier, gitlens, quokka, and my theme, everset.

  • @kevinmorte3959
    @kevinmorte3959 3 года назад +1

    nice video!

  • @ray3369
    @ray3369 4 года назад

    Awesome video man. Thanks.

  • @lifeisbeautifu1
    @lifeisbeautifu1 4 месяца назад

    Thank you

  • @alanthomasgramont
    @alanthomasgramont 3 года назад

    Thanks for the videos. You've been a great help.
    BTW, Jimmy Cleveland is a great name for a bookie. If only you have a hard NY accept.

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  3 года назад

      I'm glad to hear it. And I usually hear it's a "rock star" or "mafia" name.

  • @omarciano42
    @omarciano42 3 года назад

    If I add babel-loader to the loaders of TS and JS files, is it gonna work?

  • @NesSumSimpson
    @NesSumSimpson 3 года назад

    Why no mention of Babel or does TypeScript loader do this for you?

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  3 года назад

      Short answer is yes. But it does get a little more nuanced than that when you want cutting edge features.

    • @NesSumSimpson
      @NesSumSimpson 3 года назад

      @@SwashbucklingwithCode Understood, keeping it simple here, no need for the cutting edge features just yet, lol. Thanks!

  • @tomaszcomasz2083
    @tomaszcomasz2083 4 года назад

    Hi, when I comment scss code with //, I'm getting error unknow word //. Do you know why?

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  4 года назад

      There is a pinned comment, as well as other comments, about this in the css Webpack video. Can't be sure it's the same problem but that's one solution: ruclips.net/video/SH6Y_MQzFVw/видео.html

  • @mohamedyoussef8835
    @mohamedyoussef8835 3 года назад

    Awesome Video ++++++++++++++

  • @lunamoonfang8169
    @lunamoonfang8169 3 года назад

    Hi i have followed your steps, but for some reason i cannot call my functions in html, is there an additional set up for this? Does anyone have this issue

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  3 года назад

      You typically wouldn't in this type of setup, unless you want to bundle it more universally. You would run all your functions from the main entry point, and the subsequent files that are imported.

    • @lunamoonfang8169
      @lunamoonfang8169 3 года назад

      @@SwashbucklingwithCode hi thank you so much for the reply, can you explain this to me " run all your functions from the main entry point" in a beginner way, right now my work around is exposing my function using the window object, but im not sure if it is a good practice.

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  3 года назад

      ​@@lunamoonfang8169 It's a bit too difficult for me to do through messages, as there is a lot to unpack here.
      I would not consider using window as a good practice, to be brief. In most situations, the script being loaded into the html is the only time you would reference javascript in your html.
      You'll want to look into modern JavaScript workflows before getting too in depth into Webpack. Frameworks are one way (React, Vue, Svelte) but there are plenty of others.
      The main entry point is typically your `index.ts`, and that basically kicks off your scripts. That's the best I can do here, and just my 2 cents on the whole situation. GL.

    • @lunamoonfang8169
      @lunamoonfang8169 3 года назад

      @@SwashbucklingwithCode would you be kind enough to point me to an article/blog post on how to achieve this, I badly needed it. Currently I'm finding way to achieve this, but im not sure which is which.

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  3 года назад

      @@lunamoonfang8169 The best thing you can do is look at other projects on github, or perhaps setups in blog posts. This all seems very cart before the horse to me.
      Start by asking yourself what you need, and why you need it, and start piecing things together from there. It's the best path for learning development, imo, and everything else just leaves me confused when I try to rush it.

  • @hyfydistro
    @hyfydistro 3 года назад

    I was reading on the Webpack documentation that build performance may degrade in with TypeScript (i.e. as you have more scripts, it will be slower to compile). Then there's a workaround suggested at their site about adding an option `transpileOnly: true`. It has something to do with typechecking and linting that slows it down. One solution they have given is to have it done in another process with `ForkTsCheckerWebpackPlugin`. 😃 And here I was worried about adding too many subsets, preprocessors and other libraries.

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  3 года назад +2

      It gets quite overwhelming. As you learn each tool, it gets easier, but I try not to overoptimize if I haven't felt the pain that a tool is solving for.
      It's very alluring to have the optimal, idiomatic, modern setup right from the start, but you won't really know "why" you need those things unless you feel the pain of not having them first.

  • @xVecna
    @xVecna 4 года назад

    Why do we need Ts?

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  4 года назад

      The npm package?

    • @xVecna
      @xVecna 4 года назад

      @@SwashbucklingwithCode typescript in general im currently learning react :)

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  4 года назад +2

      @@xVecna Oh, you do not need it at all. It might actually be too much to learn at the same time as React. Typescript gives you more robust and maintainable code at the expense of the simplicity and flexibility of JavaScript. Choosing Typescript for a project depends on the scale and scope and how familiar you and your team are.

  • @NesSumSimpson
    @NesSumSimpson 3 года назад

    I was a little confused about why and what was going on when you used "npx webpack" as we had just downloaded webpack as a development dependency( "npm i -D webpack"). Why install it and then use npx? You didn't need it globally as it was installed locally? You are right, it didn't install the cli at all...hmm.. I assume that is because our builds would not have any need for a cli tool. I would of thought this cli tool would of been downloaded, at the very least locally, considering npx squawked about it, but it did not? Why didn't it download it locally if the cli was a dependency of webpack? Oh and thanks for these videos, I fix bugs and write scripts but come from a DevOps/SysOps background. Your videos have helped me alot to understand the dev side of things, thanks again!

    • @SwashbucklingwithCode
      @SwashbucklingwithCode  3 года назад

      The reason to install it and then use npx is because we hadn't set up a script to run it locally in package.json yet, which is a useful tool to know for testing things out or if you don't do something often enough to make it a script. npx will first look for a local install and then a global.
      I'm not clear on the remaining questions since it all seems to be packed into one question with separate focuses.

  • @gamerclips8895
    @gamerclips8895 2 года назад

    Jared leto in a multiverse as a front-end engineer

  • @omkarkulkarni3644
    @omkarkulkarni3644 3 года назад

    Jesus teaching webpack xD

  • @madara_u_chiha
    @madara_u_chiha 2 года назад

    Jared Leto?

  • @aminsoraya
    @aminsoraya 2 года назад +1

    You are extremely dominant

  • @egorlazuka8211
    @egorlazuka8211 4 года назад

    water
    \