Installation & Requirements
System Requirements
Section titled “System Requirements”- PHP:
8.2or higher - ProcessWire:
3.0.210or higher - First-Party Module Dependencies: None (
Viteis a standalone foundational module) - Node.js Toolchain: Node
20+and Vite5+(or6+/7+) for compiling frontend assets
Installing the Module
Section titled “Installing the Module”-
Require the package from your project root:
Terminal window composer require trk/processwire-vite -
Refresh and install the module via
processwire-console(or Modules -> Refresh in Admin):Terminal window php vendor/bin/wire module:refreshphp vendor/bin/wire module:install Vite
- Log in as a superuser and navigate to Modules -> New.
- Use Add Module from Directory (enter
Vite), Add Module from URL, or Add Module from Upload (ZIP archive). - Click Modules -> Refresh, locate
Viteunder the Site tab, and click Install.
- Download and extract the release archive into
site/modules/Vite/. - Open Modules -> Refresh in the ProcessWire admin (or run
php vendor/bin/wire module:refresh). - Click Install next to
Viteunder Modules -> Site.
Once installed, Vite registers $this->wire()->vite (and the global vite() helper function when functions.php is loaded). Open Modules -> Configure -> Vite or add a setting('vite', [...]) array in site/config.php to align rootPath, rootUrl, buildDirectory, and hotFile with your vite.config.ts.
Default Configuration Values
Section titled “Default Configuration Values”| Setting | Default | Purpose |
|---|---|---|
rootPath |
$config->paths->templates |
Absolute filesystem base directory containing hotFile and buildDirectory. |
rootUrl |
$config->urls->templates |
Public base URL prefix corresponding to rootPath. |
buildDirectory |
'build' |
Subdirectory under rootPath where Vite writes compiled production assets. |
hotFile |
'hot' |
Filename (or relative path under rootPath) written by the Vite dev server while running. |
manifest |
'manifest.json' |
Manifest filename checked at {buildDirectory}/{manifest} and {buildDirectory}/.vite/{manifest}. |
integrity |
'integrity' |
Manifest key name containing SRI hashes, or false to disable SRI output. |
nonce |
null |
Optional default CSP nonce string applied to emitted <script> and <link> tags. |