1.0.0 • Published 1 year ago

vite-plugin-mpg v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

1.0.0

1 year ago

0.1.0

1 year ago

0.1.1

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.14

1 year ago

0.0.15

1 year ago

0.0.16

1 year ago

0.0.1

1 year ago