Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 1.12 KB

README.md

File metadata and controls

57 lines (45 loc) · 1.12 KB

better-stats-webpack-plugin

Usable stats output for webpack builds.

Install

npm install --save-dev better-stats-webpack-plugin

Usage

const BetterStatsWebpackPlugin = require("better-stats-webpack-plugin");

module.exports = {
  entry: {
    main: 'src/app.js',
    admin: 'src/admin.js'
  },
  output: {
    filename: '[name].js',
    path: path.resolve(workspace, 'dist'),
    publicPath: 'https://s3.eamon.sh/my-app/'
  },
  module: {
    rules: [...]
  },
  plugins: [
    new BetterStatsWebpackPlugin({ statsFile: './better-stats.json' }),
  ]
}

Result

{
  "[entry]_js": ["[public-file-path].js"],
  "[entry]_js_import": "<script src=\"[public-file-path].js\"></script>",
  "[entry]_css": ["[public-file-path].css"],
  "[entry]_css_import": "<link rel=\"stylesheet\" href=\"[public-file-path].css\"/>",
  
  "assets": [
    "src/cat.gif": "[public-file-path].gif"
  ]
}

Options

statsFile

Description: Better stats output path
Default: $PWD/better-stats.json