Webpack Plugins

This is an experimental API! YMMV

Although Greenwood aims to provide a complete development environment out of the box, we recognize that for those users who are comfortable with webpack might want to introduce customizations using actual webpack plugins themselves.


Below is an example of using the Banner Plugin to add text to each file generated by webpack in greenwood.config.js.

const webpack = require('webpack');
const { version } = require('package.json');

module.exports = {


  plugins: [{
    type: 'webpack',
    provider: () => {
      return new webpack.BannerPlugin(`My App v${version}`);



Although we can't promise all webpack plugins will work, we will try and document which ones we have had success with either as part of the CLI or one of our composite plugins. | Name | Notes | |---|---| | BannerPlugin | Used as an example in unit tests for @greenwood/cli. | | CopyWebpackPlugin | Used as part of our Polyfills Plugin (@greenwood/plugin-polyfills) to copy @webcomponentsjs/* polyflls files to Greenwood's output directory. (publicDir).

Known Issues

Currently there are no known issues (yet). 🤞