1.0.0 • Published 3 years ago
webpack-filter-console-loader
Licence
ISC
Version
1.0.0
Deps
0
Size
3 kB
Vulns
0
Weekly
0
webpack-filter-console-loader
A webpack loader that filters out console.log statements. By default, it retains the logs added by the current Git user. However, you can specify other authors using the allow option.
Installation
Using npm:
npm install webpack-filter-console-loader --save-dev
Or using yarn:
yarn add webpack-filter-console-loader --dev
Usage
Directly in Webpack Configuration:
module: {
rules: [
{
test: /\.js$/,
use: 'webpack-filter-console-loader'
}
]
}
Using configureWebpack in Vue CLI:
In your vue.config.js:
module.exports = {
configureWebpack: {
module: {
rules: [
{
test: /\.js$/,
use: 'webpack-filter-console-loader'
}
]
}
}
}
Using chainWebpack in Vue CLI:
In your vue.config.js:
module.exports = {
chainWebpack: config => {
config.module
.rule('js')
.test(/\.js$/)
.use('webpack-filter-console-loader')
.loader('webpack-filter-console-loader')
.end();
}
}
Options
allow (Optional)
An array of git authors whose console.log statements should be retained in the code. If this option is not provided, the loader will retain only the console.log statements added by the current Git user.
Example:
{
loader: 'webpack-filter-console-loader',
options: {
allow: ['Author1', 'Author2']
}
}
License
MIT (You can add a LICENSE file to your repository and link it here.)