Plugins

Plugins allow us to inject custom build steps during the bundling process.

A commonly used plugin is the html-webpack-plugin. This allows us to generate HTML files required for production. For example it can be used to inject script tags for the output bundles.

  1. new HtmlWebpackPlugin({
  2. template: './src/index.html',
  3. inject: 'body',
  4. minify: false
  5. });

原文: https://angular-2-training-book.rangle.io/handout/project-setup/plugins.html