Asset List Webpack Plugin
This is a webpack plugin that outputs a simple list of generated assets with your webpack bundle.
Install
npm install --save-dev asset-list-webpack-plugin
Usage
The plugin will generate a JSON file that lists all of the generated assets from the webpack bundle process. The format of this list can be changed by setting different options.
Here is a basic example utilizing a simple config from the webpack Getting Started guide:
webpack.config.js
const path = ; const AssetListWebpackPlugin = ; moduleexports = entry: './src/index.js' output: filename: 'main.js' path: path plugins: ;
This will generate a JSON file in the output path containing the following:
assets.json
Additionally, you pass an object of options to change the format of the JSON file like so:
webpack.config.js
const path = ; const AssetListWebpackPlugin = ; moduleexports = entry: './src/index.js' output: filename: 'main.js' path: path plugins: name: 'file-list' format: 'object' key: 'name' ;
This will generate a JSON file that contains the following:
file-list.json
Options
Name | Type | Default | Description |
---|---|---|---|
name | {String} |
'assets' |
Name of generated JSON file |
format | {'array'\|'object'} |
'array' |
Format of generated JSON file |
key | {'filename'\|'name'\|'type'\|'fingerprint'} |
'filename' |
Set keys for object formatted JSON file |
License
This open source project is licensed under the MIT License.