Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Miofly/vite-plugin-multi-pages
Multi Page for vite
https://github.com/Miofly/vite-plugin-multi-pages
Last synced: 14 days ago
JSON representation
Multi Page for vite
- Host: GitHub
- URL: https://github.com/Miofly/vite-plugin-multi-pages
- Owner: Miofly
- Created: 2022-06-29T13:58:10.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-11T07:41:41.000Z (8 months ago)
- Last Synced: 2024-10-01T12:35:36.219Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 84 KB
- Stars: 25
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- fucking-awesome-vite - vite-plugin-multi-pages - Multi Pages Support,can build src/pages anyPage,can set prefixName. (Plugins / Framework-agnostic Plugins)
- awesome-vite - vite-plugin-multi-pages - Multi Pages Support,can build src/pages anyPage,can set prefixName. (Plugins / Framework-agnostic Plugins)
README
# vite-plugin-multi-pages
**English** | [中文](./README.zh_CN.md)
> Multi page applications supporting vite - vue2、3, react, etc
## How To Use
### Install
```sh
yarn add vite-plugin-multi-pages
# or
pnpm add vite-plugin-multi-pages
```### ToConfigure
**vite.config.ts**
```typescript
import mpa from 'vite-plugin-multi-pages';export default defineConfig({
plugins: [mpa(/* options */)],
});
```## Options
```typescript
export interface MpaOptions {
/**
* defaultOpenPage
* @default true
* @example / (root path) | true (first page) | test-two
*/
defaultOpenPage: '/' | boolean | string;
/**
* scanning dir
* @default src/views
*/
scanDir: string;
/**
* scanFile
* @default 'main.{js,ts,jsx,tsx}'
*/
scanFile: string;
/**
* html fileName
* @default 'index.html'
*/
filename: string;
/**
* rewrite rule list
* @default []
*/
rewrites: Rewrite[];
/**
* open or build a specific page under scanDir
* @default ''
* @example test-one,test-twos
*/
specialPageNames: string;
/**
* ignore open or build a specific page under scanDir
* @default ''
* @example test-twos
*/
ignorePageNames: string;
}
```## examples
- [src/examples](https://github.com/Miofly/vite-plugin-multi-pages/tree/master/examples/vite-plugin-demo)
## More
- Cooperate `vite-plugin-html-template-mpa`
plugin : [https://github.com/Miofly/vite-plugin-html-template-mpa](https://github.com/Miofly/vite-plugin-html-template-mpa)
- Cooperate `vite-plugin-vconsole-mpa` plugin config
vconsole : [https://github.com/Miofly/vite-plugin-vconsole-mpa](https://github.com/Miofly/vite-plugin-vconsole-mpa)