Skip to content

Latest commit

 

History

History
60 lines (43 loc) · 890 Bytes

README.md

File metadata and controls

60 lines (43 loc) · 890 Bytes

description

Plugin that count the relevant resource information generated by the build and output it formatted to the specified file

clone & install

  • clone
git clone https://github.com/cattle-code/webpack-plugin-assets-report.git
  • npm
npm install
  • build
npm run build

usage

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 |