Configuration

Configuration options for WPZylos Assets.

Vite Dev Server

Set the Vite dev server URL via constant in wp-config.php:

define('WPZYLOS_VITE_DEV_SERVER', 'http://localhost:5173');

Or use the hot file method (default):

# Vite automatically creates this file during `npm run dev`
echo "http://localhost:5173" > dist/hot

Asset Versioning

By default, assets use the plugin version from ContextInterface::version(). Override per-asset:

$assets->script('app')
    ->src('dist/js/app.js')
    ->version('2.1.0');

Manifest Location

By default, the ViteAssetResolver looks for manifest at:

{plugin_path}/dist/.vite/manifest.json

Custom Cron Schedules

The AssetManager does not use cron, but the AssetsServiceProvider hooks into:

  • wp_enqueue_scripts — Frontend assets
  • admin_enqueue_scripts — Admin assets

Default Dependencies

Common WordPress script handles you can use as dependencies:

HandleLibrary
jqueryjQuery
wp-apiWordPress REST API client
wp-api-fetchModern REST API fetch
wp-elementReact (WordPress wrapper)
wp-componentsWordPress UI components
wp-i18nInternationalization
wp-dataWordPress data store