delete-console-loader
v1.0.2
Published
删除代码中的console语句
Downloads
5
Readme
一个用来删除代码中console语句的loader
安装
npm install delete-console-loader --save-dev
or
yarn add delete-console-loader
使用
修改您项目中的webpack配置, 例如:
{
test: /\.(js|mjs|jsx|ts|tsx)$/,
include: paths.appSrc,
use: [
{
loader: require.resolve('babel-loader'),
options: {
customize: require.resolve(
'babel-preset-react-app/webpack-overrides'
),
plugins: [
[
require.resolve('babel-plugin-named-asset-import'),
{
loaderMap: {
svg: {
ReactComponent: '@svgr/webpack?-svgo,+ref![path]',
},
},
},
],
],
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
cacheCompression: isEnvProduction,
compact: isEnvProduction,
},
},
// 主要是添加下面这段代码
{
loader: 'delete-console-loader',
},
]
},