Socket
Socket
Sign inDemoInstall

babel-plugin-resolve-vconsole

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-resolve-vconsole

A babel plugin to automatically remove the vconsole in the production environment


Version published
Weekly downloads
2
Maintainers
1
Created
Weekly downloads
 

Readme

Source

公司移动端项目打包自动去除 vconsole 代码

Usage

npm i babel-plugin-resolve-vconsole --save-dev (or yarn)
  • in babel config file (eg .babelrc)
{
  plugins: ['remove-vconsole']
}
  • webpack production config file

{
  test: /\.(js|jsx|mjs)$/,
  include: paths.appSrc,
  loader: require.resolve('babel-loader'),
  options: {
    customize: require.resolve(
      'babel-preset-react-app/webpack-overrides'
    ),

    plugins: ['remove-vconsole', ...],

    // 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: true,
    compact: true
  }
}

打包之后,自动去除 Vconsole 的 引入

import VConsole from 'vconsole';
new VConsole();

FAQs

Last updated on 24 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc