horizom/vite

The Horizom Routing package.

Maintainers

👁 lambirou

Package info

github.com/horizom/vite

Homepage

pkg:composer/horizom/vite

Statistics

Installs: 176

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

5.0.0 2024-04-11 22:20 UTC

Requires

  • php: ^8.0

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 12f40649be1a64922e4c52d0b83b22177f2412d9

  • Roland Edi <rolandedi.woop@codivoire.com>

JShorizonbundlerhorizomviteesbuild

This package is not auto-updated.

Last update: 2026-06-20 08:14:48 UTC


README

👁 Total Downloads
👁 Latest Stable Version
👁 License

Description

Vite is a modern frontend build tool that provides an extremely fast development environment and bundles your code for production.

This plugin configures Vite for use with a PHP backend server.

Usage

use Horizom\Vite\Vite;

// Your entry point
$entry = 'resources/js/app.js';

$config = [
 
 /**
 * The build directory (default: 'public/dist')
 */
 'outputDir' => 'public/dist',

 /**
 * Force development mode (default: false)
 */
 'forceDev' => false,

 /**
 * The host (default: 'http://localhost:5173')
 */
 'host' => 'http://localhost:5173',

 /**
 * The manifest file (default: '.vite/manifest.json')
 */
 'manifest' => '.vite/manifest.json',

 /**
 * The base path (default: '')
 */
 'basePath' => '',
];

$plugin = new Vite($config);

// Render the html tags
$plugin->render($entry);

And setup your vite config in vite.config.js file

import { defineConfig, splitVendorChunkPlugin } from "vite";
import path from "node:path";
import vue from "@vitejs/plugin-vue";
import liveReload from "vite-plugin-live-reload";

export default defineConfig({
 plugins: [
 vue(),
 liveReload([
 __dirname + "/resources/views/**/*.php",
 __dirname + "/app/*.php",
 ]),
 splitVendorChunkPlugin(),
 ],
 publicDir: path.resolve(__dirname, "storage/assets"),
 base: process.env.APP_ENV === "development" ? "/" : "/dist/",
 build: {
 outDir: "./public/dist",
 emptyOutDir: true,
 manifest: true,
 rollupOptions: {
 input: path.resolve(__dirname, "resources/js/app.js"),
 },
 },
});

License

The Laravel Vite plugin is open-sourced software licensed under the MIT license.