Exclude folder from type checking but not from transpilation - tsconfig #18953
Unanswered
jonaskinnvall
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I'm working on a react project where we currently, to demo the app, need to use MSW to mock our requests and respond with some specific and large amount of data. This data (a very big array of objects) is returned from javascript files in a certain folder within the project.
These files needs to be included in the build (for msw to use in mocking responses), so I have allowed js in my
tsconfig.json
(allowJs: true
). But I don't want them to be included when using typescript for type checking - either by runningtsc
or with the VSCode bundled "TypeScript and JavaScript Language Features" extension which can't run properly now either. I cannot currently type check my project because these large files makes the js heap run out of memory.I tried to just exclude the relevant folder in my
tsconfig.json
, but that of course excludes it from transpilation as well, so that the build fails.Is there a way to configure typescript to exclude a folder when type checking but not from transpilation when running
vite build
?tsconfig.json
:tsconfig.node.json
:Beta Was this translation helpful? Give feedback.
All reactions