https://github.com/just-ads/vite-plugin-multi-page
multi-page-application for vite
https://github.com/just-ads/vite-plugin-multi-page
Last synced: 7 days ago
JSON representation
multi-page-application for vite
- Host: GitHub
- URL: https://github.com/just-ads/vite-plugin-multi-page
- Owner: just-ads
- Created: 2024-04-18T10:56:09.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-19T08:25:22.000Z (12 months ago)
- Last Synced: 2025-03-21T04:06:14.654Z (29 days ago)
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- fucking-awesome-vite - vite-plugin-mpg - Simple configuration of multi page applications. (Plugins / Framework-agnostic Plugins)
- awesome-vite - vite-plugin-mpg - Simple configuration of multi page applications. (Plugins / Framework-agnostic Plugins)
README
# vite-plugin-mpg
> multi-page-application for vite## Usage
```shell
npm install vite-plugin-mpg -D
``````js
// vite.config.js
import vitePluginMultiPage from "vite-plugin-mpg";// @see https://vitejs.dev/config/
export default defineConfig({
// ...
plugins: [
// ...other plugins
vitePluginMultiPage(/* options */),
],
})
```## Options
```ts
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