Skip to content

Conversation

@jacenre
Copy link
Contributor

@jacenre jacenre commented Apr 5, 2022

Vite SSG does not set any $isServer variable to detect if it should server render, so this should do it fine!

https://github.com/antfu/vite-ssg/blob/0be88a5e14aeb9fe1c518642f5f72c99fc5bbfc7/src/node/build.ts#L77

@jacenre jacenre mentioned this pull request Apr 5, 2022
@danielroe danielroe changed the title Simple fix for vite-ssg support fix: add support for vite-ssg with process.env.VITE_SSG Apr 5, 2022
Copy link
Owner

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a reasonable solution. I imagine in most places where we're consuming vue-sanity there would be a browser polyfill for process.env.

@danielroe danielroe merged commit dfe5af0 into danielroe:main Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants