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

  Рет қаралды 11,583

TechTechGo

TechTechGo

Күн бұрын

I actually struggled to generate Development and Production builds for Node/Express app. So, I decided to create a video to help others. P
Github Repository : github.com/tec...

Пікірлер: 47
@techtechgo
@techtechgo Жыл бұрын
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 5 ай бұрын
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 4 ай бұрын
Thanks 😊
@ladislavteply9856
@ladislavteply9856 11 ай бұрын
Great tutorial helps me a lot. Thanks.
@AnonymousPumpkin616
@AnonymousPumpkin616 2 ай бұрын
i did it and worked fine. now can u explain how we can host this for free of cost
@sanjayajanakantha7883
@sanjayajanakantha7883 Жыл бұрын
Thank you
@techtechgo
@techtechgo Жыл бұрын
Pls check the pinned comment to resolve the warning msg.
@manishyadav-lk6vb
@manishyadav-lk6vb 11 ай бұрын
Good Explanation
@Kahipan1324
@Kahipan1324 10 ай бұрын
@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?
@babukamal473
@babukamal473 Ай бұрын
need webpack file
@bhavikdoshi4866
@bhavikdoshi4866 8 ай бұрын
can you send this code?
@funtoo_trader
@funtoo_trader 8 ай бұрын
Can we use this for huge project with controller and mongo
@abhishektotad3183
@abhishektotad3183 9 ай бұрын
it show Error: Please install tedious package manually
@chesterxp508
@chesterxp508 7 ай бұрын
GoodJob!
@tradinghubindia5230
@tradinghubindia5230 11 ай бұрын
How well can it handle concurrent requests
@chiragsolanki1234
@chiragsolanki1234 3 ай бұрын
can you provide github link??
@techtechgo
@techtechgo 3 ай бұрын
Unfortunately it is not available on Github...
@user-ud2vq1nr1e
@user-ud2vq1nr1e 9 ай бұрын
Whats the point to bundle server code ????!?
@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.
@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?
@dylanmarais35
@dylanmarais35 Жыл бұрын
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?
@developer_hadi
@developer_hadi Жыл бұрын
Thank you, is this obligatory before I deploy my rest api?
@techtechgo
@techtechgo Жыл бұрын
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
@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...
@sjljc2019
@sjljc2019 8 ай бұрын
Can we run the build file using PM2??
@techtechgo
@techtechgo 8 ай бұрын
Unfortunately I don't have any idea about it.
@sjljc2019
@sjljc2019 8 ай бұрын
@@techtechgo Okay. Then how will we run the build file in a prod server? Any suggestion on this part?
@techtechgo
@techtechgo 8 ай бұрын
@@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 8 ай бұрын
@@techtechgo But to execute those we might need a server like Apache2 or Nginx. Will it work on these?
@techtechgo
@techtechgo 8 ай бұрын
@@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...
@AnonymousPumpkin616
@AnonymousPumpkin616 2 ай бұрын
it is showing me an error
@saitejakondaa
@saitejakondaa 2 ай бұрын
What was the e4r94?
@techtechgo
@techtechgo 2 ай бұрын
@@AnonymousPumpkin616 what is the error?
@techtechgo
@techtechgo 2 ай бұрын
@@saitejakondaa wher can you see it?
@AnonymousPumpkin616
@AnonymousPumpkin616 2 ай бұрын
@@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 2 ай бұрын
@@techtechgo it worked completely fine for me thanks mate
Node.js is a serious thing now… (2023)
8:18
Code With Ryan
Рет қаралды 645 М.
女孩妒忌小丑女? #小丑#shorts
00:34
好人小丑
Рет қаралды 101 МЛН
Matching Picture Challenge with Alfredo Larin's family! 👍
00:37
BigSchool
Рет қаралды 53 МЛН
SCHOOLBOY. Мама флексит 🫣👩🏻
00:41
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 6 МЛН
when you have plan B 😂
00:11
Andrey Grechka
Рет қаралды 43 МЛН
How to build docker image for nodejs apps
28:47
Hitesh Choudhary
Рет қаралды 79 М.
How to scale NodeJs applications using the cluster module.
13:37
Mafia Codes
Рет қаралды 50 М.
How to Deploy a Node.js Puppeteer App to Render.com for Free
18:38
Module Federation in React | React Micro Frontend
21:03
AVDojo
Рет қаралды 27 М.
TypeScript and NodeJS: The Proper Setup!
13:49
Josh tried coding
Рет қаралды 47 М.
How To Use TypeScript With Express & Node
17:05
Colt Steele
Рет қаралды 70 М.
Why I'm Using Express Instead of NextJS
5:23
Josh tried coding
Рет қаралды 110 М.
女孩妒忌小丑女? #小丑#shorts
00:34
好人小丑
Рет қаралды 101 МЛН