Download the PHP package wp-spaghetti/wp-vite without Composer

On this page you can find all versions of the php package wp-spaghetti/wp-vite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-vite

PHP Version Packagist Downloads Packagist Stars GitHub Actions Workflow Status Coverage Status Known Vulnerabilities GitHub Issues GitHub Release License

Wp Vite

A powerful Vite integration service for WordPress with enhanced Docker support, obfuscated assets handling, flexible cache busting, and comprehensive logging.

Features

Installation

Install via Composer:

Quick Start

1. Initialize Wp Vite

In your plugin or theme, initialize Wp Vite with your base paths:

2. Enqueue Assets

3. Development Mode Setup

For optimal Hot Module Replacement (HMR), add the Vite client scripts in development:

What does devScripts() do?

Configuration

Wp Vite supports both WordPress-native define() constants and modern .env files for configuration through the integrated wp-env library. Additionally, it supports component-specific environment variables for multi-plugin/theme environments.

Component-Specific Configuration

Wp Vite automatically detects your plugin or theme name and supports component-specific environment variables, allowing independent configuration for each component.

Component Name Detection

Environment Variable Priority

  1. Component-specific: {COMPONENT_NAME}_VITE_{SETTING} (highest priority)
  2. Global: VITE_{SETTING}
  3. Default values

WordPress Constants (wp-config.php)

Environment File (.env)

For modern setups like Bedrock, you can use .env files:

Priority: WordPress constants take precedence over .env files, and component-specific variables take precedence over global ones.

Multi-Plugin/Theme Development

For complex WordPress installations with multiple plugins/themes:

Docker Configuration

For Docker environments, Wp Vite automatically detects the container and adjusts configuration:

Build Configuration

For advanced component-specific configuration, see Component Configuration Guide.

File Structure

Wp Vite expects the following directory structure:

Subdirectory Support

Wp Vite fully supports organizing your assets in subdirectories:

Why no file extensions? Wp Vite automatically detects the correct source file extension (.js, .ts, .jsx, .scss, etc.) and maps it to the appropriate compiled output. This makes your code cleaner and more flexible.

Asset Priority System

Wp Vite uses different file priority patterns for production and development:

Production Priority

  1. .min.obf.js/css (minified + obfuscated)
  2. .obf.js/css (obfuscated only)
  3. .min.js/css (minified only)
  4. .js/css (standard)

Development Priority

  1. .js/css (standard)
  2. .min.js/css (minified)
  3. .obf.js/css (obfuscated)
  4. .min.obf.js/css (minified + obfuscated)

API Reference

Core Methods

Vite::init(string $basePath, string $baseUrl, string $version = '1.0.0', string $componentName = '')

Initialize Wp Vite with your plugin/theme paths. This also initializes the integrated logger.

Parameters:

Vite::getPluginName(): string

Get the detected or explicitly set component name (plugin/theme name).

Vite::asset(string $entry): string

Get the URL for any asset. Automatically switches between dev server and production URLs.

Vite::enqueueScript(string $handle, string $entry, array $deps = [], bool $inFooter = true, array $attributes = [])

Enqueue JavaScript files with automatic existence checking and logging.

Vite::enqueueStyle(string $handle, string $entry, array $deps = [], string $media = 'all')

Enqueue CSS files with automatic existence checking and logging.

Utility Methods

Vite::isDevServer(): bool

Check if Vite dev server is running using environment-aware detection.

Vite::jsExists(string $entry): bool

Check if JavaScript asset exists with extension auto-detection.

Vite::cssExists(string $entry): bool

Check if CSS asset exists with extension auto-detection.

Vite::devScripts(): void

Output Vite client scripts for HMR (development only).

Vite::getDebugInfo(): array

Get comprehensive debug information including environment details for troubleshooting.

Returns information about:

Example Usage

Plugin Integration

Traditional WordPress Setup (without Bedrock)

If you're not using Bedrock or modern WordPress setups, you can configure Wp Vite using WordPress constants in wp-config.php:

Then in your plugin or theme:

Theme Integration

Docker Setup

For Docker environments, Wp Vite provides automatic detection and configuration. Your docker-compose.yml might look like:

Set your environment variables:

Logging & Debugging

Wp Vite includes comprehensive logging through the integrated WP Logger library:

Debug Information

Logging Configuration

For detailed information about log levels, log files, and advanced logging configuration, see the WP Logger documentation.

Requirements

Changelog

Please see CHANGELOG for a detailed list of changes for each release.

We follow Semantic Versioning and use Conventional Commits to automatically generate our changelog.

Release Process

All releases are automatically created when changes are pushed to the main branch, based on commit message conventions.

Contributing

For your contributions please use:

See CONTRIBUTING for detailed guidelines.

Sponsor

Buy Me A Coffee

License

(ɔ) Copyleft 2025 Frugan.
GNU GPLv3, see LICENSE file.


All versions of wp-vite with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
wp-spaghetti/wp-env Version ^2.0
wp-spaghetti/wp-logger Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wp-spaghetti/wp-vite contains the following files

Loading the files please wait ...