Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

hyde-vite-plugin

hydephp115MIT1.0.0-RC.4TypeScript support: included

HydePHP Vite plugin for realtime compiler integration

hydephp, hyde, vite, plugin

readme

HydePHP Vite Plugin

Official Vite plugin for HydePHP's realtime compiler integration.

Installation

npm install hyde-vite-plugin --save-dev

Usage

// vite.config.js
import { defineConfig } from 'vite';
import hyde from 'hyde-vite-plugin';
import tailwindcss from '@tailwindcss/vite';

export default defineConfig({
    plugins: [
        hyde({
            // Optional configuration
            input: ['resources/assets/app.css', 'resources/assets/app.js'],
            // Files to watch for changes, in addition to input paths
            watch: ['_pages', '_posts', '_docs'],
        }),
        tailwindcss(),
    ],
});

Options

Option Type Default Description
input string[] ['resources/assets/app.css', 'resources/assets/app.js'] Asset entry points to process
watch string[] ['_pages', '_posts', '_docs'] Content directories to watch for changes
refresh boolean true Enable hot reloading for content files

Contributing

Contributions to this package are made in the development monorepo hydephp/develop in the packages/vite-plugin directory. Make sure to link your local NPM package!

License

The MIT License (MIT). Please see License File for more information.

changelog

Changelog

Please note that this package is a companion package to hyde/hyde and hyde/realtime-compiler and is not intended to be used outside of those environments. No such support will be given, and the major version ranges used for all three must match the compatibility matrix.

1.0.0 (Initial Release)

  • Initial release of the HydePHP Vite Plugin
  • Extracted Vite server functionality from the main vite.config.js into a dedicated plugin
  • Added TypeScript support
  • Added configuration options for customizing input files and content refresh
  • Implemented internal IPC hot file handling