Webpack 101


Plugins

Plugins are a little less clear-cut compared to Loaders. Unlike loaders, they are unconcerned with transpiling files, and more concerned with facilitating a robust build process

A common plugin that you might want to use is the DefinePlugin. This can allow you to insert variable values at build time (helpful for inserting things like the date, environment, etc.). In this example, we replace INSERTED_STRING with some build-time string:

                
  plugins: [
    new DefinePlugin({
      INSERTED_STRING: '\"I am an inserted string!\"'
    })
  ]