Registry / devops / yyl-webpack-plugin-base

yyl-webpack-plugin-base

JSON →
library0.2.2jsnpmunverified

Base class for creating webpack plugins in the yyl ecosystem. Stable version 0.2.2. Provides a TypeScript-friendly foundation with built-in lifecycle hooks, validation, and type definitions. Differentiates by offering a streamlined API for yyl-related plugins, but limited outside that context.

npm install yyl-webpack-plugin-base
INSTALL
IMPORT
SIG · YYL-WEBPACK-PLUGIN
Y
yyl-webpack-plugin-base
devopsjavascriptv0.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

YylWebpackPluginBase
import { YylWebpackPluginBase } from 'yyl-webpack-plugin-base'
const YylWebpackPluginBase = require('yyl-webpack-plugin-base')
Package is ESM; named export only.
PluginOptions
import type { PluginOptions } from 'yyl-webpack-plugin-base'
import { PluginOptions } from 'yyl-webpack-plugin-base'
TypeScript type export, not runtime value.
HookNames
import { HookNames } from 'yyl-webpack-plugin-base'
Enum-like object for lifecycle hooks.

Creates a custom webpack plugin extending YylWebpackPluginBase with lifecycle hooks.

import { YylWebpackPluginBase } from 'yyl-webpack-plugin-base'; import type { Compiler } from 'webpack'; class MyPlugin extends YylWebpackPluginBase { constructor() { super({ name: 'MyPlugin' }); } apply(compiler: Compiler): void { compiler.hooks.compilation.tap(this.name, (compilation) => { console.log('Compilation started'); }); } } export default MyPlugin;
Debug
Known issues
breakingVersion 0.x may have breaking changes between minor releases.
fix
Pin to exact version and test upgrades.
affects: <1.0.0
gotchaPlugin name must be passed to super(), otherwise getName() returns 'undefined'.
fix
Always call super({ name: 'YourPluginName' }) in constructor.
affects: >=0.1.0
deprecatedOld hook registration pattern .registerHook() is deprecated in favor of constructor options.
fix
Use hooks option in super() instead.
affects: >=0.2.0
Errors
Common errors & fixes
Error: Cannot find module 'yyl-webpack-plugin-base'
Package not installed or missing from node_modules.
fix
Run 'npm install yyl-webpack-plugin-base' or 'yarn add yyl-webpack-plugin-base'.
TypeError: Super expression must either be null or a function
Using CommonJS require() instead of ESM import.
fix
Change to 'import { YylWebpackPluginBase } from 'yyl-webpack-plugin-base''.
Property 'pluginName' does not exist on type 'MyPlugin'
Accessing a property not exposed by the base class.
fix
Use this.getName() instead of this.pluginName.
Upgrade
Version history
0.2.2latest on npm
Audit
Dependencies
webpackrequiredpeer dependency required for plugin compatibility
Agent activity
18 hits · last 30 days
node
14
Resources
yyl-webpack-plugin-base — npm install yyl-webpack-plugin-base · libregistry