Skip to content

Commit

Permalink
fix(vite): proper path for main.tsx for standalone (#14575)
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini authored and vsavkin committed Jan 24, 2023
1 parent 1444f58 commit ba3c8c8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/vite/src/utils/generator-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,15 @@ export function moveAndEditIndexHtml(
let indexHtmlPath =
projectConfig.targets[buildTarget].options?.index ??
`${projectConfig.root}/src/index.html`;
const mainPath = (
let mainPath =
projectConfig.targets[buildTarget].options?.main ??
`${projectConfig.root}/src/main.ts${
options.uiFramework === 'react' ? 'x' : ''
}`
).replace(projectConfig.root, '');
}`;

if (projectConfig.root !== '.') {
mainPath = mainPath.replace(projectConfig.root, '');
}

if (
!tree.exists(indexHtmlPath) &&
Expand Down

0 comments on commit ba3c8c8

Please sign in to comment.