@mbsks/rspfx-plugin-api
v0.0.13
Published
RSPFX plugin API: FrameworkPreset, extension hooks
Readme
@mbsks/rspfx-plugin-api
Plugin API of RSPFX — an SPFx-compatible build toolchain powered by Rspack.
Lets you extend the toolchain with RspfxExtension instances: framework presets, compiler hooks, and package hooks.
Install
npm i @mbsks/rspfx-plugin-apiUsage
import { definePlugin, registerPlugin, getPlugins } from '@mbsks/rspfx-plugin-api';
import type { FrameworkPreset } from '@mbsks/rspfx-plugin-api';
const preset: FrameworkPreset = {
name: 'my-framework',
contributions() {
return { swc: { jsc: { parser: { syntax: 'typescript' } } } };
}
};
registerPlugin(definePlugin({ name: 'my-framework', frameworkPreset: preset }));API
definePlugin(plugin)— typed plugin factoryregisterPlugin(plugin)/getPlugins()— global registry (wired by the CLI)- Types:
RspfxExtension,FrameworkPreset,FrameworkRspackContributions,CompilerHooks,PackageHooks
Links
- RSPFX documentation
- Internal API contract
- License: MIT
