@jitar/plugin-vite
v0.10.3
Published
Vite plugin for Jitar.
Readme
Jitar Plugin for Vite
This plugin allows you to use Vite to build your Jitar app.
Installation
npm install --save-dev @jitar/plugin-viteUsage
The plugin needs to be added to the vite config file.
// vite.config.ts
import { defineConfig } from 'vite'
import jitar, { JitarConfig } from '@jitar/plugin-vite'
const jitarConfig: JitarConfig = {
sourceDir: 'src',
targetDir: 'dist',
jitarDir: 'domain',
jitarUrl: 'http://localhost:3000',
segments: [],
middleware: []
}
export default defineConfig({
plugins: [
jitar(jitarConfig)
]
})The plugin accepts a configuration object with the following properties:
- sourceDir - The folder containing the app’s source files. In most cases, this is the
srcfolder. - targetDir - The folder where the app’s distribution files are output. In most cases, this is the
distfolder. - jitarDir - The folder containing the source files used by Jitar, relative to the source root. We typically use
domain(which refers tosrc/domain), but feel free to use a different path. - jitarUrl - The URL of the Jitar instance. By default, Jitar uses
http://localhost:3000, but this can be changed in the Jitar configuration. - segments - The segments to use for the client app. This should be an array of strings. The default value is an empty array.
- middleware - The middleware to use for the client app. This should be an array of strings. The default value is an empty array.
