@liuyingbo/dorp-log-loader
v1.0.1
Published
Xsiganl private js library.
Downloads
10
Readme
dorp-log-loader for webpack
安装 diff-loader
npm install @liuyingbo/dorp-log-loader --save-dev 或 yarn add @liuyingbo/dorp-log-loader -D
修改webpack配置文件
module: { ... rules: [ ... { test: /\.js$/, use: [{ loader: '@liuyingbo/filter-loader', options: { drop_console: process.env.NODE_ENV === 'production', type: ['info', 'error', 'log'], // 数组类型 reg: /(console.info\()(.*)(\))|(console.log\()(.*)(\))/g // 支持正则 过滤其他的 代码内容 }, include: [resolve('/src')] exclude: /(node_modules)/ }] }, ... ] ... }