webpack
webpack
@coder_aishya
01
What is Webpack ?
Webpack is a module bundler for modern
JavaScript applications.
Bundler bundle.js
Bundler bundle.css
Optimized
Bundler
jpg
@coder_aishya
02
Entry
Output
Loaders
Plugins
Mode
Browser Compatibility
@coder_aishya
03
When webpack processes your application, it internally
builds a dependency graph from one or more entry points
and then combines every module your project needs into
one or more bundles, which are static assets to serve your
content from.
Entry
An entry point indicates which module webpack
should use to begin building out its internal
dependency graph.
webpack.config.js
@coder_aishya
04
Output
this configuration parameter simply tells the
Webpack where to output the bundle that it creates.
webpack.config.js
@coder_aishya
05
Loaders
After sepcifying the entry point for the application,
the next thing to tell our Webpack is what should it
do with the files within our project. In other words,
what kind of transformations that need to be applied
to our files.
To do that, we have something called the 'loaders'. By
default, Webpack looks at all the JSON and JS files to
build the dependency graph as shown above.
@coder_aishya
06
webpack.config.js
Plugins
@coder_aishya
07
webpack.config.js
@coder_aishya
08
Mode
By setting the mode parameter to either
development, production or none, you can enable
webpack's built-in optimizations that correspond to
each environment. The default value is production.
webpack.config.js
Browser Compatibility
Webpack supports all browsers that are ES5-
compliant (IE8 and below are not supported).
Webpack needs Promise for import() and
require.ensure(). If you want to support older
browsers, you will need to load a polyfill before using
these expressions.
@coder_aishya
Follow me for more
aishwarya-dhuri
coder_aishya