Skip to content
Discussion options

You must be logged in to vote

Refactor your browser and server logic into separate files. Then, import them through a subpath import, specifying a browser condition resolving to the client logic, and a default condition resolving to the server logic. This means you simply import getDefaultLanguage from, for example, #lib/language.ts and always resolve the correct browser/server variant depending on where it’s used, without relying on dead code elimination which Rolldown is unable to do correctly at present.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@balthild
Comment options

@balthild
Comment options

Answer selected by teemingc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants