rsbuild-plugin-rempa
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

rsbuild-plugin-rempa

npm npm npm

A Rsbuild plugin designed to collect pages and generate a Multi-Page Application (MPA).

Note: This plugin is currently under development, and its API may be subject to change.

Installation

Install the plugin via npm:

npm install rsbuild-plugin-rempa --save-dev

Usage

Add the plugin to your rsbuild configuration file:

// rsbuild.config.ts
import { defineConfig } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
import { pluginRempa } from 'rsbuild-plugin-rempa';

export default defineConfig({
  plugins: [pluginReact(), pluginRempa()],
});

Plugin Options

  • template (string): Specifies the HTML template file to use for the generated pages. Defaults to the Rsbuild default template.
  • layout (string): Defines the default layout path for the entry page. Defaults to <>{children}</>.

Auto-Generated MPA

The plugin automatically generates entry files for each page based on the config.json files located in the src/pages directory.

Example config.json:

{
  "title": "Index Page",
  "layout": "./layout.tsx"
}

Supported config.json options include:

  • template: Path to the template file.
  • layout: Path to the page layout.
  • title: Title of the page.
  • mountElementId: The ID of the DOM node where the page will be mounted. Defaults to root.
  • Additional properties will be passed to the template as templateParameters.

Example

For a working example, see the playground.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i rsbuild-plugin-rempa

Weekly Downloads

13

Version

0.0.3

License

MIT

Unpacked Size

214 kB

Total Files

7

Last publish

Collaborators

  • sumy