Skip to content

just-ads/vite-plugin-multi-page

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-plugin-mpg

multi-page-application for vite

Usage

npm install vite-plugin-mpg -D
// vite.config.js
import vitePluginMultiPage from "vite-plugin-mpg";

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

Options

type MultiPageItem = {
    /**
     * path accessed from url
     */
    path: string
    
    /**
     * page entry
     * it doesn t have to be .html
     */
    file: string
    
    /**
     * When the `file` is not an html file, override the `template` configured by the root
     */
    template?: string
}

type MultiPagesOptions = {
    /**
     * When the `file` in MultiPageItem is not html, provide template html
     * @default 'index.html'
     */
    template?: string
    
    /**
     * pages
     */
    pages: MultiPageItem[]
}

You can also write the above configuration by creating a pages.config.json file in the project root directory

About

multi-page-application for vite

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published