@mbsks/rspfx-dev-runtime
v0.0.13
Published
RSPFX dev runtime: serve emulation, websocket refresh, fast refresh
Readme
@mbsks/rspfx-dev-runtime
Dev runtime for RSPFX — an SPFx-compatible build toolchain powered by Rspack.
Implements the workbench-first development experience: serve emulation, websocket-based refresh, state-preserving fast refresh, and project discovery (reads the project's bundler config plugin options).
Install
npm i @mbsks/rspfx-dev-runtimeUsage
import { startServe } from '@mbsks/rspfx-dev-runtime';
import { resolveConfig } from '@mbsks/rspfx-core';
const handle = await startServe({
projectRoot: process.cwd(),
config: resolveConfig({ name: 'my-app', framework: 'react', spfxVersion: '1.23' }),
port: 4321,
fastRefresh: true,
});
await handle.close();API
startServe(opts)— dev server + manifest server + workbench launch (opts: DevRuntimeOptions { projectRoot, config, port?, fastRefresh?, noBrowser?, tenantDomain?, mode? })readProject(projectRoot, paths?, versionOverride?, rspfxConfig?)— read package.json/config.json/serve.json, discover web partsloadFrameworkPreset(framework, projectRoot?)— resolve framework preset (compiler contributions)createRefreshRuntime(framework, opts?)— state-preservation refresh runtimecreateCompileContext(opts)— build aCompileContextfor the compilerDevRuntimeHandle,DevRuntimeOptions— types
Links
- RSPFX documentation
- License: MIT
