@webrium/vite-plugin
v1.0.0
Published
Official Vite plugin for the Webrium PHP framework — includes TailwindCSS, live reload, and customizable dev server logging.
Downloads
45
Maintainers
Readme
@webrium/vite-plugin
Official Vite plugin for the Webrium PHP framework.
Bundles the following into a single import:
- TailwindCSS v4 via
@tailwindcss/vite - Live reload for PHP views and JS/Vue files via
vite-plugin-live-reload - Custom dev-server logger showing Webrium branding and app URLs
Installation
npm install -D @webrium/vite-pluginBasic usage
// vite.config.js
import { defineConfig } from 'vite';
import webrium from '@webrium/vite-plugin';
export default defineConfig(({ command }) => ({
plugins: [
webrium(),
],
base: command === 'build' ? '/build/' : '/',
build: {
outDir: 'public/build',
emptyOutDir: true,
manifest: true,
rollupOptions: {
input: 'resources/js/app.js',
},
},
server: {
cors: true,
strictPort: true,
port: 5173,
},
}));With Vue.js
Install the Vue plugin separately:
npm install -D @vitejs/plugin-vueThen pass it via extraPlugins:
import { defineConfig } from 'vite';
import webrium from '@webrium/vite-plugin';
import vue from '@vitejs/plugin-vue';
export default defineConfig(({ command }) => ({
plugins: [
webrium({
extraPlugins: [vue()],
}),
],
// ...
}));Options
| Option | Type | Default | Description |
|---------------------|------------|--------------------------------------|--------------------------------------------------|
| appPort | number | 8000 | Port the PHP application runs on |
| vitePort | number | 5173 | Port the Vite dev server runs on |
| appHost | string | '127.0.0.1' | Host the PHP application runs on |
| viteHost | string | '127.0.0.1' | Host the Vite dev server runs on |
| liveReloadPaths | string[] | ['./app/Views/**/*.php', ...] | Glob patterns watched for live reload |
| extraPlugins | Plugin[] | [] | Additional Vite plugins (Vue, React, etc.) |
License
MIT
