npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rsbuild-plugin-inertia

v0.0.1

Published

Rsbuild plugin for Inertia.js page resolution and SSR build support.

Readme

rsbuild-plugin-inertia

Rsbuild plugin for Inertia.js apps in The Boring JavaScript Stack.

const { pluginVue } = require('@rsbuild/plugin-vue')
const { pluginInertia } = require('rsbuild-plugin-inertia')

module.exports.shipwright = {
  build: {
    plugins: [pluginVue(), pluginInertia()]
  }
}

What it handles

  • Centralizes Inertia-specific Rsbuild configuration.
  • Stubs Inertia v3's optional Axios adapter import when Axios is not installed, so templates do not need to ship Axios just to satisfy the bundler.
  • Injects a Boring Stack default page resolver for ./pages.
  • Supports an Inertia/Vite-style pages shorthand when apps need to override the default.
  • Lazy-loads pages by default for automatic page-level code splitting.
  • Provides an SSR build configuration path without enabling runtime SSR by default.

Vite Plugin Parity

Inertia's Vite plugin gives apps two big conveniences: page resolution and SSR developer-mode wiring. This plugin brings the page-resolution side to Rsbuild now, using Rspack primitives:

  • default ./pages resolver injection
  • pages: './pages' shorthand for explicit overrides
  • pages: { path, extension, lazy, transform } object shorthand
  • lazy page loading by default
  • lazy: false for single-bundle apps
  • framework-aware default export handling for Vue, React, and Svelte
  • automatic resolver injection when no pages or resolve is configured
  • automatic SSR entry detection when assets/js/ssr.js exists

SSR is split deliberately. The plugin can prepare a Node build environment, but Sails should decide which requests render through SSR. That keeps hybrid EJS and Inertia apps predictable and gives Boring Stack projects room for per-page SSR instead of forcing every Inertia response through one runtime policy.

Page Resolution

createInertiaApp({
  setup({ el, App, props }) {
    // mount your framework app
  }
})

The plugin detects Vue, React, or Svelte from the Inertia adapter import and generates the matching resolver for ./pages. By default it uses Rspack's lazy require.context mode, which gives Boring Stack apps the same code-splitting benefit Inertia's Vite plugin gets from import.meta.glob.

Only configure pages when an app uses a non-standard directory or wants to change resolver behavior:

createInertiaApp({
  pages: {
    path: './pages',
    lazy: false
  },
  setup({ el, App, props }) {
    // mount your framework app
  }
})

Set lazy: false when you intentionally want all pages in the initial bundle.

The shorthand also supports custom extensions and page-name transforms:

createInertiaApp({
  pages: {
    path: './screens',
    extension: ['.jsx', '.tsx'],
    transform: (name, page) => page.component || name
  },
  setup({ el, App, props }) {
    // mount your framework app
  }
})

If an app calls createInertiaApp() without pages or resolve, the plugin injects the Boring Stack default resolver for ./pages. This differs from the Vite plugin's Laravel-friendly ./pages/./Pages fallback because Rspack requires require.context directories to be static and present at build time. Apps using ./Pages can opt in explicitly with pages: './Pages'.

SSR Build Environment

Runtime SSR remains controlled by the server adapter, but the plugin prepares the Rsbuild node environment automatically when assets/js/ssr.js exists:

pluginInertia()

Only configure ssr when an app uses a non-standard SSR entry point:

pluginInertia({
  ssr: {
    entry: 'assets/js/server.js'
  }
})

Set ssr: false to disable auto-detection.

Then config/inertia.js can decide which requests actually render through SSR:

module.exports.inertia = {
  ssr: {
    enabled: true
  }
}

When enabled is true and pages is omitted, every Inertia page can SSR. Use pages: ['index', 'pricing'] to make SSR selective.

The Boring JavaScript Stack does not need a separate SSR server process; Sails imports the private .tmp/ssr/inertia.mjs bundle in-process.