Generate Development and Production builds for Node/Express app using Webpack 5

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ธ.ค. 2024

ความคิดเห็น • 49

  • @techtechgo
    @techtechgo  ปีที่แล้ว +2

    In this video, when you run `build:dev` or `build:prod` cmds, it always shows some warning msg in the terminal. I actually forgot to use already installed `webpack-node-externals` package completely. To avoid the warning msg, you simply need to update your code as follow,
    ...
    const nodeExternals = require('webpack-node-externals'); // just add this line
    `module.exports = {
    entry: {
    main: './index.js'
    },
    ...
    ...
    target: 'node',
    externals: [nodeExternals()], // just add this line
    ...
    ...
    }`
    I hope it will help you.

  • @Rohitkumar-vq1yk
    @Rohitkumar-vq1yk 8 หลายเดือนก่อน

    Thank you very much for your assistance! Your guidance has been incredibly valuable to me, especially since I was struggling to find adequate resources. Your video proved to be a significant help and saved me a lot of time. I appreciate your dedication and the wonderful work you do. Once again, thank you, and please continue your excellent work!

    • @techtechgo
      @techtechgo  7 หลายเดือนก่อน

      Thanks 😊

  • @faizan_78616
    @faizan_78616 2 หลายเดือนก่อน

    very informative video, very informative

  • @ladislavteply9856
    @ladislavteply9856 ปีที่แล้ว

    Great tutorial helps me a lot. Thanks.

  • @Kahipan1324
    @Kahipan1324 ปีที่แล้ว

    @TechTechGo suppose in the node project we are maintaining the logs in folder and also template in the folder. when we build the project how this can work? How to add static folder?

  • @AnonymousPumpkin616
    @AnonymousPumpkin616 4 หลายเดือนก่อน

    i did it and worked fine. now can u explain how we can host this for free of cost

  • @funtoo_trader
    @funtoo_trader 10 หลายเดือนก่อน

    Can we use this for huge project with controller and mongo

  • @sanjayajanakantha7883
    @sanjayajanakantha7883 ปีที่แล้ว +1

    Thank you

    • @techtechgo
      @techtechgo  ปีที่แล้ว

      Pls check the pinned comment to resolve the warning msg.

  • @babukamal473
    @babukamal473 4 หลายเดือนก่อน +1

    need webpack file

  • @manishyadav-lk6vb
    @manishyadav-lk6vb ปีที่แล้ว

    Good Explanation

  • @tradinghubindia5230
    @tradinghubindia5230 ปีที่แล้ว

    How well can it handle concurrent requests

  • @chiragsolanki1234
    @chiragsolanki1234 6 หลายเดือนก่อน +1

    can you provide github link??

    • @techtechgo
      @techtechgo  6 หลายเดือนก่อน

      Unfortunately it is not available on Github...

  • @developer_hadi
    @developer_hadi ปีที่แล้ว

    Thank you, is this obligatory before I deploy my rest api?

    • @techtechgo
      @techtechgo  ปีที่แล้ว +1

      It depends how you want to proceed but yes before you deploy your rest api. Usually there will be development and production servers. So, answer is yes if you have different servers and want to push different artifacts to different severs.

    • @developer_hadi
      @developer_hadi ปีที่แล้ว

      @@techtechgo thanks

  • @bhavikdoshi4866
    @bhavikdoshi4866 10 หลายเดือนก่อน +1

    can you send this code?

  • @webfreelancershub6718
    @webfreelancershub6718 ปีที่แล้ว

    Hi sir, Thank you so much for great tutorial. I am leaning MERN stack but I didn't have much industry experience in MERN stack, is this the best way which every company use to deploy node js code on server?

    • @techtechgo
      @techtechgo  ปีที่แล้ว

      Yes yes it is standard way but the demo I presented here is very basic. For MEAN or MERN stack, yes you will have to consider other things also but for node app, it is standard way.

    • @abduladilsunnat2489
      @abduladilsunnat2489 ปีที่แล้ว

      @@techtechgo what are some of the other things to consider?

  • @mohamedabass2736
    @mohamedabass2736 ปีที่แล้ว

    thank you i didnt know that we can have 2 webpack config files , so now we can have 2 config files one for node environment and the other one for web browser environment wright?

    • @techtechgo
      @techtechgo  ปีที่แล้ว

      No. 2 config files. 1. development environment 2. Production environment.
      Your development and Production configurations will be different.

  • @sjljc2019
    @sjljc2019 11 หลายเดือนก่อน

    Can we run the build file using PM2??

    • @techtechgo
      @techtechgo  11 หลายเดือนก่อน

      Unfortunately I don't have any idea about it.

    • @sjljc2019
      @sjljc2019 11 หลายเดือนก่อน

      @@techtechgo Okay. Then how will we run the build file in a prod server? Any suggestion on this part?

    • @techtechgo
      @techtechgo  11 หลายเดือนก่อน

      @@sjljc2019 you just have to deploy these files to your deployment server (you may think about putting CI/CD pipleline on place to do that job).

    • @sjljc2019
      @sjljc2019 11 หลายเดือนก่อน

      @@techtechgo But to execute those we might need a server like Apache2 or Nginx. Will it work on these?

    • @techtechgo
      @techtechgo  11 หลายเดือนก่อน

      @@sjljc2019 i don't use them both of them. I use cloud but I guess yes it should be possible. Those are just artifacts which you need to deploy onto server...

  • @fredylan.marais
    @fredylan.marais ปีที่แล้ว

    I see you are bundling your server code, is there a way to use webpack dev server in express with an existing express server?

    • @techtechgo
      @techtechgo  ปีที่แล้ว

      You meant how to run node/express app using webpack locally right?

  • @abhishektotad3183
    @abhishektotad3183 ปีที่แล้ว

    it show Error: Please install tedious package manually

  • @Ben-u4z4l
    @Ben-u4z4l ปีที่แล้ว

    Whats the point to bundle server code ????!?

  • @AdarshShukla-yj7br
    @AdarshShukla-yj7br 2 หลายเดือนก่อน

    You have not followed SOLID principles and neither defined connection type of server.

  • @kranthikumarreddy8632
    @kranthikumarreddy8632 ปีที่แล้ว

    Thanks for your video. in my project structure controllers and models and some other folder are there. In this folder i maintain routers. how to build the file with all files

    • @techtechgo
      @techtechgo  ปีที่แล้ว

      Yeah in real life projects, many things will be there eg. controllers, models, routes etc. However, approach will remain same. There is no difference. You can follow same steps and it must work.

    • @kranthikumarreddy8632
      @kranthikumarreddy8632 ปีที่แล้ว

      @@techtechgo Thanks its working but how to add other than js files to web pack config js file.in my application iam mainintaing js files and access.log and serverver.log files. My question is how to add log extension files to webpack

    • @techtechgo
      @techtechgo  ปีที่แล้ว

      @@kranthikumarreddy8632 sorry, I couldn't understand your requirement. Test files? Test files don't go to build artifacts. They are for development purpose and what is log files? The logs work in development , similar way it should work on your dev/prod server...

  • @chesterxp508
    @chesterxp508 10 หลายเดือนก่อน

    GoodJob!

  • @AnonymousPumpkin616
    @AnonymousPumpkin616 4 หลายเดือนก่อน

    it is showing me an error

    • @saitejakondaa
      @saitejakondaa 4 หลายเดือนก่อน

      What was the e4r94?

    • @techtechgo
      @techtechgo  4 หลายเดือนก่อน

      @@AnonymousPumpkin616 what is the error?

    • @techtechgo
      @techtechgo  4 หลายเดือนก่อน

      @@saitejakondaa wher can you see it?

    • @AnonymousPumpkin616
      @AnonymousPumpkin616 4 หลายเดือนก่อน

      @@saitejakondaa i did same as said in the video. i know my project folder structure is not good. i'm just a beginner. drive.google.com/file/d/1RB-W4fiuCYaJdiUGYkbm1_XP8B-q1ht9/view?usp=sharing

    • @saitejakondaa
      @saitejakondaa 4 หลายเดือนก่อน +1

      @@techtechgo it worked completely fine for me thanks mate