devhimal / todo

https://mytasktracker.vercel.app
1 stars 0 forks source link

Use Webpack to bundle Javascript #1

Open rrojan opened 1 year ago

rrojan commented 1 year ago

You might have noticed all major frameworks like React, Angular, etc use Webpack or a similar bundler to bundle their Javascript.

This is because when we are working with Javascript these things can happen:

So your code will break if you do any of these things.

This is where something like Webpack comes in.

Every production project using JS should use webpack to boost the speed of the website and manage complexity. This is a small project however we'll try to use Webpack for learning about it.

Good article to learn about Webpack: https://medium.com/js-imaginea/webpack-why-and-what-4948433cc2d3

TODO: Configure Webpack using webpack.config.js or similar, and create a bundle.js for this project. Link index.html to bundle instead of script.js

Also configure Babel. See JS Transpiling

rrojan commented 1 year ago

You can also use esbuild or Vite for this hai!