bta

build-time-analysis-webpack-plugin

A webpack plugin that output the build time file by file as a JSON format with filters

Showing:

Popularity

Downloads/wk

2

GitHub Stars

10

Maintenance

Last Commit

2yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.6KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

build-time-analysis-webpack-plugin

A webpack plugin that output the build time file by file as a JSON format with filters

Codacy Badge npm Github All Releases npm GitHub contributors GitHub issues PRs Welcome license

NPM

How to write a webpack plugin (Chinese)

USAGE

Install the plugin via npm or yarn:

npm install --save-dev build-time-analysis-webpack-plugin

// or 
yarn add build-time-analysis-webpack-plugin --dev

Then require it in your webpack.config.js:

const ModuleBuildTimeCalWebpackPlugin = require('build-time-analysis-webpack-plugin');

module.exports = {
  plugins: [
    new ModuleBuildTimeCalWebpackPlugin({
     filename: 'modules.json',
     includeNodeModules: false,
     callback: () => {},
   }),
  ]
};

Then you can pack your codes via commands such as npm run build, plugin's result will be output to modules.json file by default (however, you can customize it via options that passed to plugin constructor). The output JSON format is something like this:

{
  'src/index.js': {
    name: 'src/index.js',
    start: 1,
    end: 4,
    time: 3,
    loaders: [ ... ]
  },
  ...
}

API

filename [String, optional]

A string with file extension, The filename that you want plugin output the result to, default to modules.json.

includeNodeModules [Boolean, optional]

Whether to include the build time result of files inside node_modules, default to false.

callback [Function, optional]

The callback handler you want plugin called after resolve all process (correspondind lifecycle should be compilation.hooks.finishModules), default to () => {}.

CONTACT

@hijiangtao

LICENSE

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100