项目作者: FreemenL

项目描述 :
friendly display compilation details
高级语言: JavaScript
项目地址: git://github.com/FreemenL/empty-webpack-build-detail-plugin.git






empty-webpack-build-detail-plugin


friendly display compilation details


Install

  1. cnpm install empty-webpack-build-detail-plugin -D
  1. npm i empty-webpack-build-detail-plugin -D
  1. yarn add --dev empty-webpack-build-detail-plugin

This is a webpack plugin tailored for emptyd-desgin and can be used in your project. No difference

Zero Config

The empty-webpack-build-detail-plugin works without configuration.

Usage

The plugin will friendly display compilation details

webpack.config.prod.js

  1. const emptyWebpackBuildDetailPlugin = require("empty-webpack-build-detail-plugin");
  2. module.exports = {
  3. -entry: 'index.js',
  4. -output: {
  5. -path: __dirname + '/dist',
  6. -filename: 'index_bundle.js'
  7. -},
  8. plugins: [
  9. new emptyWebpackBuildDetailPlugin(options)
  10. ]
  11. }

Options

You can pass a hash of configuration options to empty-webpack-build-detail-plugin.
Allowed values are as follows

Name Type Default Description
path {String} compilation.options.context The path to use for the compile log
filename {String} 'compilation-detail.md' The file to write the compile log to. Defaults to compilation-detail.md
warnAfterBundleGzipSize {number} 512*1024 (Bit) Maximum limit for bundle files
warnAfterChunkGzipSize {number} 1024*1024 (Bit) Maximum limit for chunk files

Here’s an example webpack config illustrating how to use these options

webpack.config.js

  1. {
  2. entry: 'index.js',
  3. output: {
  4. path: __dirname + '/dist',
  5. filename: 'index_bundle.js'
  6. },
  7. plugins: [
  8. new emptyWebpackBuildDetailPlugin({
  9. path: path.join(process.cwd(),'log'),
  10. filename: 'compile-log.md'
  11. })
  12. ]
  13. }

Maintainers











freemenL