npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

machinjiri-vite-plugin

v1.2.0

Published

Vite plugin for Machinjiri framework integration

Downloads

27

Readme

# Machinjiri Vite Plugin

Seamless integration between [Vite](https://vitejs.dev) and the Machinjiri PHP framework.

- Hot Module Replacement (HMR) during development
- Automatic manifest generation for asset versioning
- Optional full-page reload on Blade‑like template changes
- Zero‑config setup for standard Machinjiri project structures

## Installation

```bash
npm install machinjiri-vite-plugin --save-dev

This plugin assumes you have Vite installed in your project. If not:

npm install vite --save-dev

Basic Usage

Create a vite.config.js file in your project root:

import machinjiri from 'machinjiri-vite-plugin';

export default {
  plugins: [
    machinjiri('resources/js/app.js', {
      refresh: true,
    }),
  ],
};

Then in your Machinjiri layout/view file, include the Vite assets using the @vite directive (provided by the framework) or manually:

<!-- Development (hot file exists) -->
<script type="module" src="http://localhost:5173/@vite/client"></script>
<script type="module" src="http://localhost:5173/resources/js/app.js"></script>

<!-- Production (build manifest used) -->
<link rel="stylesheet" href="/build/assets/app-*.css">
<script type="module" src="/build/assets/app-*.js"></script>

Configuration

The plugin accepts two arguments:

machinjiri(input, options)

input

Type: string | string[] Default: none (required)

Entry point(s) relative to the project root. Example: 'resources/js/app.js' or ['resources/js/app.js', 'resources/css/admin.css'].

options

Option Type Default Description refresh boolean false Enable full page reload when template files change. refreshPaths string | string[] [] Additional paths to watch for reload (supports glob patterns). publicDirectory string 'public' Directory where assets are publicly served. buildDirectory string 'build' Subdirectory inside publicDirectory where built assets are placed. hotFile string public/hot Path where the dev server URL is stored (used by PHP to detect dev mode).

Examples

Multiple entry points with custom build output

machinjiri([
  'resources/js/app.js',
  'resources/css/admin.css',
  'resources/js/editor.js'
], {
  publicDirectory: 'public_html',
  buildDirectory: 'assets',
})

Enable refresh with additional watch paths

machinjiri('resources/js/app.js', {
  refresh: true,
  refreshPaths: ['app/Views/**/*.mg.php', 'config/*.php'],
})

How It Works

Development Mode

· A hot file is created in the public directory containing the Vite dev server URL. · The Machinjiri framework detects this file and loads assets from the dev server. · HMR updates modules without a full page reload. · If refresh: true, changes to template files (*.mg.php, *.blade.php) trigger a full browser refresh.

Production Build

· Running vite build outputs minified assets to {publicDirectory}/{buildDirectory}. · A manifest.json file is generated to map original entry points to their hashed versions. · The framework reads the manifest to include the correct asset URLs.

Framework Integration

This plugin is designed for the Machinjiri PHP framework. If you're using a custom or different framework, ensure it:

· Checks for the existence of the hot file to switch between dev and production asset URLs. · Reads the manifest.json file to resolve asset paths in production.

License

MIT © Precious Lyson

Contributing

Issues and pull requests are welcome. Please ensure your code follows the existing style and includes appropriate tests.