Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhuweiyou/vite-plugin-mp
Configure multi-pages applications and code splitting
https://github.com/zhuweiyou/vite-plugin-mp
Last synced: 8 days ago
JSON representation
Configure multi-pages applications and code splitting
- Host: GitHub
- URL: https://github.com/zhuweiyou/vite-plugin-mp
- Owner: zhuweiyou
- License: mit
- Created: 2022-04-04T06:55:17.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-19T13:40:50.000Z (over 2 years ago)
- Last Synced: 2024-04-25T18:02:46.948Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 324 KB
- Stars: 24
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vite-plugin-mp
Configure multi-pages applications and code splitting
## Usage
```bash
npm install vite-plugin-mp -D
``````js
// vite.config.js
import { defineConfig } from 'vite'
import { ViteMpPlugin } from 'vite-plugin-mp'export default defineConfig({
plugins: [ViteMpPlugin()],
})
```add `jsconfig.json` or `tsconfig.json` to your project
```json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"src/*": ["./src/*"]
}
},
"include": ["src"]
}
```if you want to force extract `node_modules` for `vendor`, you can import `splitVendorChunkPlugin`
```js
// vite.config.js
import { defineConfig, splitVendorChunkPlugin } from 'vite'
import { ViteMpPlugin } from 'vite-plugin-mp'export default defineConfig({
plugins: [ViteMpPlugin(), splitVendorChunkPlugin()],
})
```## Example
See [example](https://github.com/zhuweiyou/vite-plugin-mp/tree/master/example) and
## Other Plugins
- [vite-plugin-minify](https://github.com/zhuweiyou/vite-plugin-minify) - Minify html in production