Skip to content

How to exclude files from Vite's dependency-analysis... #4697

Discussion options

You must be logged in to vote

The only way to exclude from Vite's dep analysis is to not import it, and it seems like down the module graph you imported src/utils/logger.ts from src/utils/index.ts? If src/utils/index.ts exports both client and server code, that may be the issue. It'd be best if you import src/utils/logger.ts directly when using it from a server-side code. That way each file works in client or server exclusively.

Let me know if that works for you, otherwise it would be easier to debug with a repro/codebase available to check out.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@karts-with-freaking-lasers
Comment options

@luucasrb
Comment options

@bluwy
Comment options

bluwy Jul 16, 2022
Collaborator

@brendon
Comment options

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