https://github.com/freemenl/empty-webpack-build-detail-plugin
friendly display compilation details
https://github.com/freemenl/empty-webpack-build-detail-plugin
chalk filesize fs-extra gzip-size recursive-readdir strip-ansi tapable
Last synced: about 1 year ago
JSON representation
friendly display compilation details
- Host: GitHub
- URL: https://github.com/freemenl/empty-webpack-build-detail-plugin
- Owner: FreemenL
- Created: 2019-02-22T01:32:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-23T09:27:22.000Z (over 7 years ago)
- Last Synced: 2025-03-20T03:02:48.143Z (about 1 year ago)
- Topics: chalk, filesize, fs-extra, gzip-size, recursive-readdir, strip-ansi, tapable
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/empty-webpack-build-detail-plugin
- Size: 15.6 KB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Install
```bash
cnpm install empty-webpack-build-detail-plugin -D
```
```bash
npm i empty-webpack-build-detail-plugin -D
```
```bash
yarn add --dev empty-webpack-build-detail-plugin
```
This is a [webpack](http://webpack.js.org/) plugin tailored for [emptyd-desgin](https://github.com/FreemenL/emptyd-admin-webpack) 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**
```javascript
const emptyWebpackBuildDetailPlugin = require("empty-webpack-build-detail-plugin");
module.exports = {
-entry: 'index.js',
-output: {
-path: __dirname + '/dist',
-filename: 'index_bundle.js'
-},
plugins: [
new emptyWebpackBuildDetailPlugin(options)
]
}
```
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**
```js
{
entry: 'index.js',
output: {
path: __dirname + '/dist',
filename: 'index_bundle.js'
},
plugins: [
new emptyWebpackBuildDetailPlugin({
path: path.join(process.cwd(),'log'),
filename: 'compile-log.md'
})
]
}
```
Maintainers