This webpack plugin leverages the very powerful Assetgraph dependency graph model discover assets that webpack doesn't know about. It then adds these assets into webpacks compilation.
This means you can reduce your configuration by avoiding manual maintenance of a manifest of files that need to be copied to the output destination after a build.
Currently webpack-assetgraph-plugin hooks into html-webpack-plugin's
html-webpack-plugin-after-emit-hook. This makes html-webpack-plugin a hard dependency for now, which might change in the future.
In your Webpack configuration add webpack-assetgraph-plugin like so:
var WebpackAssetgraphPlugin ;moduleexports =context: 'path/to/source/root'plugins:verbose: true
context is important! Assetgraph needs an understanding of what your web root is in order to resolve root-relative urls.
If you don't define
context it will default to
process.cwd(), which is usually not correct.