@malobre/vite-plugin-pages
v0.1.1
Published
Enhanced MPA DX: - in dev mode, rebase requests to `src/pages` if the requested file exists there, - in build mode, treat all files in `src/pages` as inputs and rebase them to your project root.
Downloads
5
Readme
@malobre/vite-plugin-pages
Enhanced MPA DX:
- in dev mode, rebase requests to
src/pages
if the requested file exists there, - in build mode, treat all files in
src/pages
as inputs and rebase them to your project root.
Usage
- Install
npm install --save-dev @malobre/vite-plugin-pages
- Add plugin to your vite config
import { defineConfig } from 'vite' import pages from '@malobre/vite-plugin-pages' export default defineConfig({ plugins: [pages()], })
Configuration
type Config = {
// Where your pages are stored, defaults to `src/pages`.
// Relative to vite's project root: https://vitejs.dev/guide/#index-html-and-project-root
dir: string;
};
e.g:
import { defineConfig } from 'vite'
import pages from '@malobre/vite-plugin-pages'
export default defineConfig({
plugins: [pages({
dir: "other/dir"
})],
})