Plugins

A plugin can fire at different steps in the build process. This means you can carry out extra work at a certain step. To use a plugin, you specify it in the plugins property, like so:

plugins: [new MyAwesomePlugin()]

Before we venture into an Angular webpack setup, let us first establish what we've learned so far. The webpack is able to deal with JavaScript, CSS, TypeScript, and more, and create bundles that we can include in our starter HTML file, usually called index.html. Furthermore, if configured through a config file, we can set up a number of rules. Each rule consists of a regular expression that will capture all files of a certain file ending and will point to a loader that will process the captured files. There are also things called plugins, which are able to give us further functionality at specific life cycle steps. It would, however, be nice if we put that knowledge into practice, so let's do that in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset