Member-only story

WebPack [Notes]

webpack is a module bundler for javascript applications
Difference between Gulp vs Grunt vs Bower vs Webpack vs Browserify

Question: What is a bundle in webpack?
Answer: bundle is the output file generated by webpack. It contains all of the modules which are used in application. Bundles generation process is regulated by webpack config file.

Question: In which environment does webpack work?
Answer: node.js

Question: What is a dependency graph and how does webpack build it?Answer: Any time one file depends on another, webpack treats this as a dependency. Starting from entry point(s), webpack recursively builds a dependency graph that includes every module your application needs, using import and require statements, then packages all of those modules into bundle(s).

Question: What is tree shaking?
Answer:

  • Tree shaking is a term used in the JavaScript world to describe the process of removing unused code from your final bundle.
  • This can be done with a tool like Webpack, which will analyze your code and remove any unused pieces, resulting in a smaller bundle size. This is especially important for front-end applications, where every kilobyte counts!

Question: What is Hot-Modules-Replacement?
Answer: Hot-Modules-Replacement(HMR) is webpack feature which allows to update modules in application without page reload. HMR can be used as an advanced replacement for…

--

--

Sonika | @Walmart | Frontend Developer | 11 Years
Sonika | @Walmart | Frontend Developer | 11 Years

No responses yet