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.
Using npm:
npm install webpack-filter-console-loader --save-dev
Or using yarn:
yarn add webpack-filter-console-loader --dev
module: {
rules: [
{
test: /\.js$/,
use: 'webpack-filter-console-loader'
}
]
}
In your vue.config.js
:
module.exports = {
configureWebpack: {
module: {
rules: [
{
test: /\.js$/,
use: 'webpack-filter-console-loader'
}
]
}
}
}
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();
}
}
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']
}
}
MIT (You can add a LICENSE file to your repository and link it here.)