Skip to content
PluginStats

vite-plugin-virtual-mpa weekly downloads statistics

By emosheeep (2 listings) · npm · Vite plugins

Out-of-box MPA plugin for Vite, with html template engine and virtual files support.

View on npm Fresh · Dec 6, 2026

vite-plugin-virtual-mpa has 24,827 recorded weekly downloads on npm, an increase of 17.6% over the past 30 days, ranking #971 of 3,247 tracked listings.

Weekly downloads
24,827
Official API · Dec 5, 2026
7-day growth
-5.8%
-1.5K weekly downloads
30-day growth
+17.6%
+3.7K weekly downloads
90-day growth
+67.9%
+10K weekly downloads
Rank
#971
▼ 38 in 7 days

About vite-plugin-virtual-mpa

vite-plugin-virtual-mpa ⚡

npm version awesome-vite weekly downloads license install size

Out-of-box MPA plugin for Vite 📦, with html template engine and virtual files support, generate multiple entries using only one template.

English | 中文

Features

  • 💡 EJS Template Capability
  • 💡 Fully Typed APIs and Prompts, Tiny and Pretty.
  • 🛠️ Customize the path of generated files, generate multiple files using only one template.
  • 🛠️ MPA support and History Fallback API for both dev and preview server.

Quick Start

View the cloud ide on stackblitz.com, and setup with the following scripts:

pnpm install
cd example
pnpm serve/build

Then you can try whatever you want.

Usage

pnpm add -D vite-plugin-virtual-mpa # or npm/yarn
// vite.config.ts
import { createMpaPlugin, createPages } from 'vite-plugin-virtual-mpa'

// @see https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    createMpaPlugin({
      pages: [
        /** 
         * You can write pages configuration here directly. 
         * Or use `createPages` function independently outside and then pass result to this field.
         */
      ]
    }),
  ],
})

/**
 * This function simply converts the arguments to an array and returns them.
 * It helps creating pages configuration with type hints independently outside plugin function.
 * It may also simplify your configurations because you can manage them uniformly somewhere.
 */
const pages = createPages([
  // You can pass a single page object or a pages array.
])

// @see https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    createMpaPlugin({
      pages,
    }),
  ],
})

Options

type FilterPattern = string | RegExp | (string | RegExp)[]
type RewriteRule = false | Rewrite[]
interface WatchHandler {
  (ctx: {
    server: ViteDevServer,
    file: string,
    type: Event
    /**
     * You can update the pages configuration by calling this function.
     * @params pages Your MPA core configurations, which will replace default `pages` config
     */
    reloadPages: (pages: Page[]) => void
  }): void
}

interface MpaOptions {
  /**
   * whether to print log
   * @default true
   */
  verbose?: boolean,
  /**
   * default template file
   * @default index.html
   */
  template?: `${string}.${'ejs' | 'html'}`,
  /**
   * Configure your rewrite rules, only proceed html requests.
   * @see https://github.com/bripkens/connect-history-api-fallback
   */
  rewrites?: RewriteRule,
  /**
   * Configure your preview server's rewrite rules.
   * @see https://github.com/bripkens/connect-history-api-fallback
   */
  previewRewrites?: RewriteRule,
  /**
   * Dedicated hook for transforming template HTML, inherit from `transformIndexHtml`.
   * @see https://vitejs.dev/guide/api-plugin#transformindexhtml
   */
  transformHtml?: (
    html: string,
    ctx: IndexHtmlTransformContext & { page: Page },
  ) => IndexHtmlTransformResult;
  /**
   * Use to scan directories that have similar structure to generate pages.
   * Detected pages will be appended to `pages` option, page with name existed will be ignored.
   */
  scanOptions?: {
    /**
     * Directory path to scan, subdirectory's name will be used as unique page name.
     */
    scanDirs: string | string[];
    /**
     * The entry file path relative to scanned dir.
     */
    entryFile?: string;
    /**
     * Customize the virtual file name(output filename).
     * @param name Subdirectory name
     */
    filename?: (name: string) => string;
  };
  /**
   * Sometimes you might want to reload `pages` config or restart ViteDevServer when
   * there are some files added, removed, changed and so on. You can set `watchOptions` to
   * customize your own logic.
   */
  watchOptions?: WatchHandler | {
    /**
     * Specifies the files to **include**, based on `Rollup.createFilter`
     * @see https://vitejs.dev/guide/api-plugin.html#filtering-include-exclude-pattern
     */
    include?: Exclude<FilterPattern, null>,
    /**
     * Specifies the files to **exclude**, based on `Rollup.createFilter`
     * @see https://vitejs.dev/guide/api-plugin.html#filtering-include-exclude-pattern
     */
    excluded?: Exclude<FilterPattern, null>,
    /**
     * File events you wanna deal with.
     * @default ['add', 'unlink', 'change', 'unlinkDir', 'addDir']
     */
    events?: Event[],
    /**
     * Execute your own logic when file events fired.
     */
    handler: WatchHandler
  },
  /**
   * your MPA core configurations
   */
  pages: Array<{
    /**
     * Required. Name is used to generate default rewrite rules, it just a common string and please don't include '/'.
     * You can use filename option not name option if you want to customize the path of generated files.
     */
    name: string;
    /**
     * Relative path to the output directory, which should end with .html
     * @default `${name}.html`
     */
    filename?: `${string}.html`;
    /**
     * Higher priority template file, which will overwrite the default template.
     */
    template?: string;
    /**
     * Entry file that will append to body. which you should remove from the html template file.
     */
    entry?: string;
    /**
     * Data to inject with ejs.
     */
    data?: Record<string, any>,
  }>,
  /**
   * Whether to minify html file. Powered by html-minify-terser.
   * @default false
   * @see https://github.com/terser/html-minifier-terser
   */
  htmlMinify?: Options |…

Description from the npm listing.

  • vite
  • vite-plugin
  • virtual
  • virtual-html
  • html
  • html-mpa
  • html-template
  • mpa
  • multi
  • multi-page

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

vite-plugin-virtual-mpa weekly downloads on npm, last 90 days: 24,827 weekly downloads as of Dec 5, 2026, +67.9% over 90 days.vite-plugin-virtual-mpaWeekly downloads on npm · Last 90 days24,827downloads / week+67.9% over 90 days05K10K15K20K25K30KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
vite-plugin-virtual-mpa weekly downloads on npm, last 90 days: 24,827 weekly downloads as of Dec 5, 2026, +67.9% over 90 days.

7/30/90-day growth

vite-plugin-virtual-mpa weekly downloads growth on npm: -5.8% over 7 days, +17.6% over 30 days, +67.9% over 90 days.vite-plugin-virtual-mpaWeekly downloads growth on npm24,827downloads / week now7-day growth-1,528 weekly downloads-5.8%30-day growth+3,711 weekly downloads+17.6%90-day growth+10,037 weekly downloads+67.9%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
vite-plugin-virtual-mpa weekly downloads growth on npm: -5.8% over 7 days, +17.6% over 30 days, +67.9% over 90 days.

Ranking history

vite-plugin-virtual-mpa npm ranking history: currently #971 (by weekly downloads).vite-plugin-virtual-mpanpm ranking · by weekly downloads · Last 90 days#971current rank#400#500#600#700#800#900#1000#1100Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
vite-plugin-virtual-mpa npm ranking history: currently #971 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 49, #11 (overall #971)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 9, #6 (overall #166)
Vite plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (591)
Recent weekly downloads observations for vite-plugin-virtual-mpa
Date (UTC)Weekly downloadsChange vs. previous
24,827+297
24,530+1.2K
23,372+496
22,876-3.5K
26,390+388
26,002+50
25,952-403
26,355-355
26,710-1.7K
28,360-1.4K
29,798+3.9K
25,910+490
25,420+1
25,419—

Similar npm Vite plugins plugins

All 20 vite-plugin-virtual-mpa alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/vite-plugin-virtual-mpa. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.