We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87d846f commit 01c6259Copy full SHA for 01c6259
src/Commands/Init.php
@@ -134,8 +134,15 @@ private function updateEnvFile()
134
# Define framework.
135
if ($this->framework !== 'none')
136
{
137
- $updates = file_get_contents($envFile);
138
- $updates = str_replace("VITE_FRAMEWORK='none'", "VITE_FRAMEWORK='$this->framework'", $updates);
+ $envContent = file_get_contents($envFile);
+ # Set framework.
139
+ $updates = str_replace("VITE_FRAMEWORK='none'", "VITE_FRAMEWORK='$this->framework'", $envContent);
140
+ # React entry file (main.jsx).
141
+ if ($this->framework !== 'react')
142
+ {
143
+ $updates = str_replace("VITE_ENTRY_FILE='main.js'", "VITE_ENTRY_FILE='main.jsx'", $envContent);
144
+ }
145
+
146
file_put_contents($envFile, $updates);
147
}
148
0 commit comments