Swup Base Plugin
Base class for creating swup plugins.
Creating a Plugin
To create a new plugin, use the official swup plugin template. It comes with detailed instructions and the required tooling.
Usage
import Plugin from '@swup/plugin';
export default class PluginName extends Plugin {
name = 'PluginName';
mount() {}
unmount() {}
}
Commands
The base plugin installs npm commands to help with bundling and linting plugin code.
Bundling
Bundle the plugin for production using microbundle, creating ESM and UMD builds.
swup-plugin-bundle
Linting
Lint the plugin code using prettier and swup's recommended rules.
swup-plugin-lint