webpack plugin for generating file list every page.
yarn install webpack-page-assets-plugin
Create a webpack.config.js
file:
const AssetsPlugin = require("webpack-page-assets-plugin");
const options = {};
module.exports = {
plugins: [
new AssetsPlugin(options)
]
}
And run webpack:
$ npx webpack
With default options, it will create a filelist.json
file in the output directory for the build. This will contain the name of page and its corresponding entry file paths.
For example:
[
{
"pageName": "App",
"files": [
"chunk-vendors.5764437f3776509621e4.js",
"app.3971705be3aede5e7cac.js"
]
}
]
Type: String
Default: filelist.json
Specifies the file name to use for the resulting file list. By default, the plugin will emit filelist.json to your output directory. Passing an absolute path to the fileName option will override both the file name and path.
Type: String
Default: <webpack-config>.output.publicPath
A path prefix that will be added to values of the manifest.
Type: Array<RegExp | String>
Default: []