vite-plugin-mpa_gmsp
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

vite-plugin-mpa

Out-of-the-box multi-page-application (MPA) support for Vite - supports Vue2/3, React and others

Usage

yarn add vite-plugin-mpa
// vite.config.ts
import mpa from 'vite-plugin-mpa'

// @see https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    // ...other plugins
    mpa(/* options */),
  ],
})

Options

{
  /**
   * open url path when server starts (customizable)
   * @default path of first-page
   */
  open: string
  /**
   * where to locate pages
   * @default 'src/pages', e.g. src/views
   */
  scanDir: string
  /**
   * @default[] if empty, use single scanDir
   */
  scanDirs: string[]
  /**
   * how to locate page files (passed to fast-glob), e.g. index.{js,jsx}
   * @default 'main.{js,ts,jsx,tsx}'
   */
  scanFile: string
  /**
   * what is your html file name, e.g. index.html / main.html / entry.html / template.html
   * @default 'index.html'
   */
  filename: string
}

Package Sidebar

Install

npm i vite-plugin-mpa_gmsp

Weekly Downloads

3

Version

1.1.4

License

MIT

Unpacked Size

350 kB

Total Files

5

Last publish

Collaborators

  • komoreby