Registry / devops / vconsole-webpack-plugin

vconsole-webpack-plugin

JSON →
library1.8.0jsnpmunverified

Webpack plugin that automatically injects vConsole (a mobile web debug panel) into webpack bundles. Current stable version is 1.8.0. The plugin wraps vConsole as a webpack plugin to simplify integration during development and ensure removal in production via a simple enable flag. Key differentiator: zero manual script injection, configurable via webpack config, supports entry filtering and conditional enabling based on CLI arguments. Releases are infrequent, last updated in 2019.

npm install vconsole-webpack-plugin
INSTALL
IMPORT
SIG · VCONSOLE-WEBPACK-P
V
vconsole-webpack-plugin
devopsjavascriptv1.8.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ const vConsolePlugin = require('vconsole-webpack-plugin');
✗ import vConsolePlugin from 'vconsole-webpack-plugin';
This package does not ship ESM, so using ES import will fail unless transpiled with a bundler or use with Node ESM interop.
vConsolePlugin
✓ const vConsolePlugin = require('vconsole-webpack-plugin');
✗ require('vconsole-webpack-plugin').default;
The export is directly the constructor, not a default property on an object.
vConsolePlugin
✓ import vConsolePlugin from 'vconsole-webpack-plugin';
✗ import { vConsolePlugin } from 'vconsole-webpack-plugin';
Named import is incorrect; the package exports a single default entity.

Demonstrates how to configure vconsole-webpack-plugin in webpack.config.js, enabling it only in non-production environments with optional entry filtering.

// webpack.config.js const vConsolePlugin = require('vconsole-webpack-plugin'); const isDebug = process.env.NODE_ENV !== 'production'; module.exports = { entry: './src/index.js', output: { filename: 'bundle.js' }, plugins: [ new vConsolePlugin({ enable: isDebug, filter: [] // optional: array of entry file names to exclude }) ] };
Debug
Known issues
gotchaenable defaults to true if not set, so vConsole will be injected in production builds if omitted.
fix
Always explicitly set enable: process.env.NODE_ENV !== 'production' or similar.
affects: all
gotchaThis plugin is outdated; vConsole has since moved to v3 with breaking changes, but the plugin may not be compatible.
fix
Check vConsole version compatibility; consider using vConsole CDN script directly for newer versions.
affects: current (1.8.0)
gotchaIn webpack 5+ the plugin may not work correctly due to API changes.
fix
Use with webpack 4 or manually adjust the plugin's integration; for webpack 5 consider alternative solutions.
affects: >=1.8.0
Errors
Common errors & fixes
Error: Cannot find module 'vconsole-webpack-plugin'
Package not installed or installed as devDependency but required at runtime in a script that doesn't include node_modules.
fix
Ensure the package is listed in devDependencies and run 'npm install' in the correct directory.
TypeError: vConsolePlugin is not a constructor
Incorrect import: using named import { vConsolePlugin } instead of default import.
fix
Use 'const vConsolePlugin = require("vconsole-webpack-plugin");'
Module parse failed: Unexpected token (1:0) - You may need an appropriate loader to handle this file type.
The plugin might try to inject ES6 module syntax but webpack is not configured to handle it (e.g., no babel-loader for node_modules).
fix
If the plugin source is included in the bundle, ensure webpack can transpile ES6 modules, or add node_modules to babel-loader exclusion? Actually, the plugin should work OOTB; this error may happen if the plugin's distributed files are not CommonJS. Reinstall or use a different version.
Upgrade
Version history
1.8.0latest on npm
Audit
Dependencies
vconsoleoptionalvConsole is bundled? No, but the plugin expects vConsole to be available at runtime if not injected as source.
Agent activity
14 hits · last 30 days
node
14
Resources
vconsole-webpack-plugin — npm install vconsole-webpack-plugin · libregistry