Exports metadata of all used node modules of a webpack bundle to a file.
This plugin creates a list with the name, version, license, and link to the repo of each node module in the webpack bundle.
The output file name can be configured, and defaults to npm-modules.md
const ExportNodeModules = require('webpack-node-modules-list');
module.exports = {
plugins: [
new ExportNodeModules()
]}
An options object may be passed to the constructor.
This option allows to filter the output so that it only includes chunks with a matching chunk name.
This option allows to change the name of the output file. The file path is relative to the webpack output directory.
This option allows to change the output format. markdown
and json
are supported.
This plugin works perfectly with the SplitByPathPlugin
plugin.
The example below demonstrates all configurable features.
const ExportNodeModules = require('webpack-node-modules-list'),
SplitByPathPlugin = require('webpack-split-by-path'),
chunkName = 'vendor';
module.exports = {
plugins: [
new SplitByPathPlugin([
{
name: chunkName,
path: path.join(__dirname, 'node_modules')
}
]),
new ExportNodeModules({chunkName, outputFile: 'npm', format: 'markdown'})
]}