Raised: $0
0% of monthly goal Help us cross the finish line!
Goal: $12,000
Raised: $0 Goal: $12,000
0% of monthly goal Help us cross the finish line!
Sponsor DDEV

Vite+ for DDEV

DDEV addon that provides Vite+ commands to run inside your DDEV project.

What is Vite+?

Vite+ is the unified toolchain for the web, providing a complete development environment with Vite, package management, testing, and more.

Install

In your DDEV project:

ddev add-on get somehow-digital/ddev-viteplus
ddev restart

Commands

URLs

The dev server container exposes Vite on:

Internal Container Access: From other DDEV containers (e.g., PHP/web container), use:

Configuration

Craft CMS

When using the Vite Plugin, configure as follows:

config/vite.php

<?php

use craft\helpers\App;

return [
    'useDevServer' => Craft::$app->config->general->devMode,
    'checkDevServer' => true,
    'devServerInternal' => 'http://viteplus:5173',
    'devServerPublic' => App::env('DEFAULT_SITE_URL') . ':5173',
    'serverPublic' => '/dist/',
    'includeReactRefreshShim' => false,
    'includeModulePreloadShim' => false,
    'manifestPath' => '@webroot/dist/.vite/manifest.json',
];

vite.config.js

export default {
  server: {
    host: '0.0.0.0',
    port: 5173,
    allowedHosts: [
      'viteplus',
    ],
  },
}