Hey! Is this project still maintaning? I found a problem when using SSR. But the last update is 5 years ago. If you are willing to fix your issues, let me know and I'll try to make a PR.
When using SSR/SSG in a SPA project, it actually renders twice: The first render converts library specified code to rendered HTML at build time or on server, and the second render runs on browser which requires user's browser to execute.
The first render is on server side, which means it is node enviroment, which doesn't have a 'window'. If someone imports your library, it will cause building to fail.
So it's necessary to determine whether the current enviroment is SSR/SSG. If so, only
rendering and 0 wait time is permitted to draw real text. That improves SEO and make initial loading a lot faster. Otherwise, just quit the function call.
Hey! Is this project still maintaning? I found a problem when using SSR. But the last update is 5 years ago. If you are willing to fix your issues, let me know and I'll try to make a PR.
When using SSR/SSG in a SPA project, it actually renders twice: The first render converts library specified code to rendered HTML at build time or on server, and the second render runs on browser which requires user's browser to execute.
The first render is on server side, which means it is node enviroment, which doesn't have a 'window'. If someone imports your library, it will cause building to fail.
So it's necessary to determine whether the current enviroment is SSR/SSG. If so, only