Plugin that count the relevant resource information generated by the build and output it formatted to the specified file
- clone
git clone https://github.com/cattle-code/webpack-plugin-assets-report.git
- npm
npm install
- build
npm run build
webpack.config.js
const path = reuqire("path");
const resolve = (...args) => path.resolve(process.cwd(), ...args);
const { AssetsReportPlugin } = require("../src/index");
module.exports = {
mode: "production",
entry: resolve("exaple/index.js"),
output: {
path: resolve("example/dist"),
filename: "bundle.js",
},
plugins: [
new AssetsReportPlugin({
path: resolve("example/dist/report"),
filename: "files.md",
}),
],
};
dist/report
# assets table
| file | size |
|--------|--------|
| bundle.js | 45 |