diff --git a/.ddev/.env.web b/.ddev/.env.web new file mode 100644 index 0000000..2acb2d2 --- /dev/null +++ b/.ddev/.env.web @@ -0,0 +1,10 @@ +CRAFT_DB_SERVER="db" +CRAFT_DB_DATABASE="db" +CRAFT_DB_PASSWORD="db" +MAILPIT_SMTP_HOSTNAME="127.0.0.1" +MAILPIT_SMTP_PORT="1025" +CRAFT_DB_DRIVER="mysql" +CRAFT_DB_PORT="3306" +PRIMARY_SITE_URL="https://viget-craft-starter.ddev.site" +CRAFT_DB_USER="db" +CRAFT_WEB_ROOT="/var/www/html/web" diff --git a/config/general.php b/config/general.php index bca2155..8cfba38 100644 --- a/config/general.php +++ b/config/general.php @@ -10,6 +10,7 @@ use craft\config\GeneralConfig; use craft\helpers\App; +use craft\helpers\StringHelper; return GeneralConfig::create() // Set the default week start day for date pickers (0 = Sunday, 1 = Monday, etc.) @@ -23,5 +24,6 @@ // Set the @webroot alias so the clear-caches command knows where to find CP resources ->aliases([ '@webroot' => dirname(__DIR__) . '/web', - ]) -; + '@web' => App::env('PRIMARY_SITE_URL'), + '@primarySiteUrl' => StringHelper::ensureRight(App::env('PRIMARY_SITE_URL'), '/'), + ]); diff --git a/config/project/sites/default--35b563a0-4662-40b9-b885-a8450a2868d9.yaml b/config/project/sites/default--35b563a0-4662-40b9-b885-a8450a2868d9.yaml index 2e2368d..a9f358b 100644 --- a/config/project/sites/default--35b563a0-4662-40b9-b885-a8450a2868d9.yaml +++ b/config/project/sites/default--35b563a0-4662-40b9-b885-a8450a2868d9.yaml @@ -1,4 +1,4 @@ -baseUrl: $PRIMARY_SITE_URL +baseUrl: '@primarySiteUrl' enabled: true handle: default hasUrls: true diff --git a/config/vite.php b/config/vite.php index 47c974e..86ef3a7 100644 --- a/config/vite.php +++ b/config/vite.php @@ -1,6 +1,7 @@ preg_replace('/:\d+$/', '', $host) . ':' . $httpsPort, + 'devServerPublic' => StringHelper::trimRight(preg_replace('/:\d+$/', '', $host), '/') . ':' . $httpsPort, 'serverPublic' => '/dist/', 'useDevServer' => App::env('CRAFT_ENVIRONMENT') === 'dev', 'manifestPath' => '@webroot/dist/.vite/manifest.json', diff --git a/package-lock.json b/package-lock.json index 374af11..74a82bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,8 +24,8 @@ "postcss-pxtorem": "^6.1.0", "prettier": "^3.5.2", "tailwindcss": "^4.0.0", - "vite": "^6.3.5", - "vite-plugin-static-copy": "^2.2.0" + "vite": "^6.3.6", + "vite-plugin-static-copy": "^2.3.2" } }, "node_modules/@alloc/quick-lru": {