run-plugin-webpack
raw JSON → 1.0.0 verified Sat Apr 25 auth: no javascript
Provides a basic class for creating Webpack plugins. Version 1.0.0 offers a straightforward structure to extend and implement the `apply` method. Released as an initial version with minimal documentation. Differentiates by being a minimal base class for Webpack plugin development.
Common errors
error Cannot find module 'run-plugin-webpack' ↓
cause Package not installed or incorrect import path.
fix
Run
npm install run-plugin-webpack --save-dev and ensure import is correct. Warnings
gotcha Package documentation is incomplete; README only contains 'TO DO.' ↓
fix Refer to source or contact maintainer for usage details.
Install
npm install run-plugin-webpack yarn add run-plugin-webpack pnpm add run-plugin-webpack Imports
- RunPluginWebpack
import { RunPluginWebpack } from 'run-plugin-webpack' - default wrong
const RunPluginWebpack = require('run-plugin-webpack')correctimport RunPluginWebpack from 'run-plugin-webpack' - RunPluginWebpack wrong
import runPluginWebpack from 'run-plugin-webpack'correctimport { RunPluginWebpack } from 'run-plugin-webpack'
Quickstart
import { RunPluginWebpack } from 'run-plugin-webpack';
class MyPlugin extends RunPluginWebpack {
apply(compiler) {
compiler.hooks.done.tap('MyPlugin', () => {
console.log('Build completed!');
});
}
}
module.exports = MyPlugin;