1.0.6 • Published 5 years ago
webpack-build-log-plugin v1.0.6
cnpm install webpack-build-log-plugin -D
npm i webpack-build-log-plugin -D
yarn add --dev webpack-build-log-plugin
This is a webpack plugin tailored for emptyd-desgin and can be used in your project. No difference
The webpack-build-log-plugin
works without configuration.
The plugin will friendly display compilation details
webpack.config.prod.js
const WebpackBuildLogPlugin = require("webpack-build-log-plugin");
module.exports = {
plugins: [
new WebpackBuildLogPlugin(options)
]
}
You can pass a hash of configuration options to webpack-build-log-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 |
deleteFile | {boolean} | false | Whether to delete compilation output |
Here's an example webpack config illustrating how to use these options
webpack.config.js
{
entry: 'index.js',
output: {
path: __dirname + '/dist',
filename: 'index_bundle.js'
},
plugins: [
new webpackBuildLogPlugin({
path: path.join(process.cwd(),'log'),
filename: 'compile-log.md',
// Note: Compile logs will only be output in the production environment.
//And you need to set process.env.NODE_ENV in different environments.
deleteFile: process.env.NODE_ENV=="production"
})
]
}