### Build Examples Source: https://github.com/web-infra-dev/rslib/blob/main/AGENTS.md Builds only the example projects. ```bash pnpm build:examples ``` -------------------------------- ### Start Development Server Source: https://github.com/web-infra-dev/rslib/blob/main/examples/module-federation/mf-host/README.md Run this command to start the development server for the Module Federation host application. ```bash pnpm dev ``` -------------------------------- ### Example AI Prompt for Migration Source: https://github.com/web-infra-dev/rslib/blob/main/website/docs/en/guide/start/ai.mdx After installing the 'migrate-to-rslib' skill, use natural language prompts to initiate the migration process. This example shows a prompt to help migrate a tsc project to Rslib. ```text Help me migrate this tsc project to Rslib ``` -------------------------------- ### Start Development Server Source: https://github.com/web-infra-dev/rslib/blob/main/examples/module-federation/mf-remote/README.md Starts the development server for the Module Federation remote module. Use this for local development and testing. ```bash pnpm dev ``` -------------------------------- ### Install Dependencies with pnpm Source: https://github.com/web-infra-dev/rslib/blob/main/AGENTS.md Installs all project dependencies and builds packages in the postinstall script. ```bash pnpm install ``` -------------------------------- ### Inspect Command Output Example Source: https://github.com/web-infra-dev/rslib/blob/main/website/docs/en/guide/basic/cli.mdx Example output when running `npx rslib inspect`, indicating the generated configuration files. ```text ➜ npx rslib inspect Inspect config succeed, open following files to view the content: - Rsbuild Config: /project/dist/.rsbuild/rsbuild.config.mjs - Rspack Config (esm): /project/dist/.rsbuild/rspack.config.esm.mjs - Rslib Config: /project/dist/.rsbuild/rslib.config.mjs ``` -------------------------------- ### Start Host App Source: https://github.com/web-infra-dev/rslib/blob/main/examples/module-federation/README.md Starts the host application that consumes Module Federation remote modules. Access the app at http://localhost:3000. ```bash pnpm dev:host ``` -------------------------------- ### Install Dependencies with Rslib Source: https://github.com/web-infra-dev/rslib/blob/main/packages/create-rslib/template-common/README.md Use this command to install all necessary project dependencies. ```bash {{ packageManager }} install ``` -------------------------------- ### Start Remote Module Source: https://github.com/web-infra-dev/rslib/blob/main/examples/module-federation/README.md Starts the remote module for Module Federation development. Use this command before starting other related services. ```bash pnpm dev:remote ``` -------------------------------- ### Start Storybook for MF Development Source: https://github.com/web-infra-dev/rslib/blob/main/examples/module-federation/README.md Starts the Storybook environment for developing Module Federation components. Access Storybook at http://localhost:6006. ```bash pnpm dev:storybook ``` -------------------------------- ### Install Rslib Source: https://github.com/web-infra-dev/rslib/blob/main/website/docs/en/api/start/index.mdx Install the `@rslib/core` package using your preferred package manager. ```bash npm install @rslib/core -D # or yarn add @rslib/core -D # or pnpm add @rslib/core -D ``` -------------------------------- ### Install React Framework Integration Source: https://github.com/web-infra-dev/rslib/blob/main/website/docs/en/guide/advanced/storybook.mdx Installs the specific Storybook framework integration package for React. ```bash add storybook-react-rsbuild -D ``` -------------------------------- ### Create Rslib Instance Source: https://github.com/web-infra-dev/rslib/blob/main/website/docs/en/api/javascript-api/core.mdx Instantiate Rslib with basic options. Use this to start a new Rslib build process. ```typescript import { createRslib } from '@rslib/core'; const rslib = await createRslib({ config: { // Rslib configuration }, }); ``` -------------------------------- ### Install Optional Skill for Coding Agents Source: https://github.com/web-infra-dev/rslib/blob/main/website/docs/en/guide/start/quick-start.mdx Install an optional skill, such as 'rslib-best-practices', for coding agents during project creation. ```bash npx -y create-rslib@latest my-project -t react --skill rslib-best-practices ``` -------------------------------- ### Run Storybook Development Server Source: https://github.com/web-infra-dev/rslib/blob/main/website/docs/en/guide/advanced/storybook.mdx Command to start the Storybook development server for live preview and interaction. ```bash npx storybook dev ``` -------------------------------- ### Start Storybook Development Server Source: https://github.com/web-infra-dev/rslib/blob/main/packages/create-rslib/template-storybook/AGENTS.md Use this command to launch the Storybook development server for interactive component development. ```bash {{ packageManager }} run storybook ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/web-infra-dev/rslib/blob/main/website/docs/en/guide/start/quick-start.mdx Install project dependencies using your package manager. This is a necessary step after creating the project. ```bash npm install ``` -------------------------------- ### Start Rslib MF Module Source: https://github.com/web-infra-dev/rslib/blob/main/examples/module-federation/README.md Starts the Rslib Module Federation module. This is typically done after starting the remote module. ```bash pnpm dev:mf ``` -------------------------------- ### Install @microsoft/api-extractor for Bundling Source: https://github.com/web-infra-dev/rslib/blob/main/packages/plugin-dts/README.md Install the API extractor as a development dependency when enabling the bundle option. ```bash npm add @microsoft/api-extractor -D ``` -------------------------------- ### Develop Module Federation Module Source: https://github.com/web-infra-dev/rslib/blob/main/examples/module-federation/mf-react-component/README.md Run this command to start the development server for the Module Federation React component. ```bash pnpm run dev ``` -------------------------------- ### Button Component Documentation Example Source: https://github.com/web-infra-dev/rslib/blob/main/website/docs/en/guide/advanced/rspress.mdx Example of documenting a Button component in MDX format. Includes JSX previews for different button states (size, background) and an API section using the component. ```mdx # Button ## Size ```jsx preview import { Button } from '@your-scope/your-package'; export default () =>