Coding Shorts: Building with Vite - Customizing Production Builds

Поделиться
HTML-код
  • Опубликовано: 7 сен 2024
  • I've been using Vue (via Vite) with ASP.NET Core lately and I needed to build for testing and production. While I'd gotten comfortable with the Vue-CLI to customize the build, it was time to learn now Rollup works with Vite to customize my build. Take a look and what I came up with.
    If you like this video, you might like other videos in my Instructional Videos:
    - • Instructional Videos
    Or my Pluralsight Courses:
    - shawnl.ink/psa...

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

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

    Thank you very much! I'm using Vite to build a WordPress plugin with React and this video helped me get over a crucial part of it!

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

    sir, you got a new follower.
    You have a really good didactics. Your talk speed, non use of unecessary words and objectivityness amazingly help to mantain the focus.
    Also you does explain details (the whays) that the most would just pass, which is a huge plus content.

  • @MobiusCoin
    @MobiusCoin Год назад +3

    OMG This video is a godsend. I'm trying to replace webpack as my bundler but Vite very much seems like it was build for Node-based SPAs in mind. I just need some scss and ts processed so that my WordPress themes can enqueue them and I could not for the life of me figure out how to do just. Again this video is amazing!

  • @VigneshBhaskar
    @VigneshBhaskar Год назад +1

    Thank you very much for this useful info.

  • @63montywilliams50
    @63montywilliams50 Год назад +1

    having a similar issue and stumbled upon this video for the solution. Good content!

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

    You literally saved me, i spent several ours looking for some explanation like this. THANKS a lot! You got a new follower and a new like!

  • @johnyepthomi892
    @johnyepthomi892 Год назад

    Thank you man. You're delivery style is invaluable. I Hope you keep making content with the same on point delivery. The way things are taught can either make it harder and demotivate someone or make it easier to learn and keep moving forward. I dislike content creators that intentionally or unintentionally intorduces complexity to what could have been explained in an easier way. I appreciate folks like you that makes it easier to keep moving forward rather than be stuck on config issues etc. Theres a lot to take in in this space as it is , and the more non core tasks are made easier, the more productive everyone can be. Thanks again.

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

    Well done - great introduction! Thank you, sir.

  • @ravi_verma31
    @ravi_verma31 4 месяца назад +1

    Amazing Explaination

  • @alvinyanson
    @alvinyanson Год назад

    Great video on customizing production builds with Vite. I appreciate the tips and tricks you shared!

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

    thank you so much for this video, it was basically exactly what i needed

  • @nzuzomal4545
    @nzuzomal4545 5 месяцев назад

    This was amazing!

  • @ivanotero2050
    @ivanotero2050 Год назад

    Thks for your time, excelent video

  • @luisangelcortinaalmeida2210
    @luisangelcortinaalmeida2210 Год назад

    Literally saved me hours of work!!!

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

    Thank you so much for this video!

  • @sandan3
    @sandan3 Год назад +1

    Very cool! I'd be interested to see a video on how to integrate internationalization with vite, pinia and a cms

  • @codescandy
    @codescandy Год назад

    Thank you so much.

  • @barneysmith
    @barneysmith Год назад

    thank you. i was playing around with vite but couldn't get rid of the hashes in the filenames, which made it very useless for me. i will now try it again.

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

    Great helped me lot, i am moving away from webpack

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

    This helped a lot! Thank you so much.

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

    Fantastic! Very good explanation.

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

    Thanks Brother!! You saved us

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

    Thanks for the explanation. this was helpful.

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

    can you show me how to setting up the environment of ASP .net core 6 with vite + vue 3..

  • @entupropiocanvas
    @entupropiocanvas Год назад

    Great job!

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

    Thanks for the tutorial

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

    Very easy to understand, thanks :)

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

    excellent explanation!!!

  • @mohitsoni3819
    @mohitsoni3819 5 месяцев назад +1

    Sir You gain one more subscriber for helping me

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

    Thx for the explanation!
    I don't understand how to build my app and include, in the building process, all the things (pages, services and components) I've created inside src folder. Could you help me with that please?

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

    Im still using webpack because of the documentation and the tons of plugins it has to offer

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

      No reason to move if you're comfortable. I've moved to Vite because it's so much faster for development and so this seemed like a natural direction with it.

  • @jonwinder6622
    @jonwinder6622 Год назад

    I got a good video topic for this channel. Vite 4 tutorial. There isnt a SINGLE one out there.

    • @swildermuth
      @swildermuth  Год назад

      Interesting, i'll add it to the list.

    • @jonwinder6622
      @jonwinder6622 Год назад

      @@swildermuth Guaranteed traffic. Not a single tutorial out there.

    • @swildermuth
      @swildermuth  Год назад

      Until I get a video on it, I do have an article about it (not v4 though, but most is still the same): www.codemag.com/Article/2109071/Introducing-Vite-A-Better-Vue-CLI

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

    Thank you very much!!!! can you show how intgrate in vs 2019 mvc ?

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

      Video coming on how to do that.

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

    I'm not sure how entry points work for dev or production/build when used in another context (like WordPress plugin). Since the PHP framework is outputting the pages dynamically with PHP, my Vue app doesn't really have one little html entry point or one to compile with the transformed filenames and paths and such.
    How would I go about developing without using a single html entry point file, but instead require the entire PHP framework to run in order to run my app? In other words, WordPress has to run, which runs the theme and displays the pages where I output shortcode which then runs my plugin which then outputs the Vue stuff. So my entry point is a dynamic page created by WP, not one html file in my Vue project folder.
    I can't find much info about using any other kind of "entry" beside an html file in the project root.

    • @ontheruntonowhere
      @ontheruntonowhere Год назад

      I don't know how Vue works specifically, but I think it's similar to React, in which your entry point is an ID in the page template. If you're working on a WP plugin or theme, use Shawn's method of stripping the hash from your build files, load your assets as you normally would using wp_enqueue_script(), and target the ID in your PHP template.

  • @thetpaingsoe1423
    @thetpaingsoe1423 10 месяцев назад

    Thanks for your awesome video. It is really help me. But i got one problem with browser caching. For example, i uploaded index.js and it work fine. But later i edited something and uploaded edited index.js. There, my browser i only loading the index.js from cache. So, my latest changes are not working well in my browser. It work only when i clean the browser cache or i open with private window. Do you have any suggestion? Thanks

    • @swildermuth
      @swildermuth  10 месяцев назад

      Not sure what you're using for the server-side, but in general you'll need to use a cache busting solution (e.g. yourfile.js?b=;alskdjf;laksd) or enable the cache busting that is built into vite. Production builds should do this by default but I think I may have told you to remove in the example. Search for Vite + Cache Busting and you'll see good examples.

    • @thetpaingsoe1423
      @thetpaingsoe1423 10 месяцев назад

      @@swildermuth Thanks for your reply. I will check it out. But for now, i re-enabled the hash key in vite config for production.

  • @timshaq
    @timshaq Месяц назад

    where minify

    • @swildermuth
      @swildermuth  Месяц назад

      Not sure this has anything to do with minifying. What's the context?

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

    You scare me

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

      why

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

      @@migueljara9399 Idk he is looking exactly to my eyes and IDK talks very calm

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

      Senior developers must be and look serious.