-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(vite): Rename entry-client.tsx to entry.client #8592
Conversation
@cannikin would you mind giving this a once over? Small change! |
…into chore/rename-entry-client * 'chore/rename-entry-client' of github.com:dac09/redwood: Move fastify.logger.infos to fastify.logger.traces (redwoodjs#8590) Make the fastify logger respect the LOG_LEVEL value set in the env (redwoodjs#8588) feat: Update the SDL types lib (redwoodjs#8586) Fix the codegen path for the GraphQL context objcet (redwoodjs#8585) chore(deps): update dependency @clerk/types to v3.42.0 (redwoodjs#8584) feat(codemod): Add codemod for js to jsx conversion (redwoodjs#8551)
const viteConfigPath = `${getPaths().web.base}/vite.config.${ | ||
ts ? 'ts' : 'js' | ||
}` | ||
const viteConfigPath = getPaths().web.viteConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dac09 this is coming up as null
for me. Took a quick look and I think it's because resolveFile
tries to find a file that exists, but in projects that aren't configured for Vite (the ones that would be more likely to use this command), there's no file, .js
or .ts
to resolve:
redwood/packages/project-config/src/paths.ts
Line 194 in cd34b8b
viteConfig: resolveFile(path.join(BASE_DIR, PATH_WEB_DIR_CONFIG_VITE)), |
redwood/packages/project-config/src/paths.ts
Lines 126 to 137 in cd34b8b
export const resolveFile = ( | |
filePath: string, | |
extensions: string[] = ['.js', '.tsx', '.ts', '.jsx'] | |
): string | null => { | |
for (const extension of extensions) { | |
const p = `${filePath}${extension}` | |
if (fs.existsSync(p)) { | |
return p | |
} | |
} | |
return null | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, ofcourse. That's probably why I did it this way before ;) I'll revert
Renames the Vite entry point from
entry-client
toentry.client
as per discussion during CTM.This is sort-of a breaking change - if user's already opted in to Vite. We need to find a good place to mention this in the release notes.