I am using Vite with a Typescript React project. I have jest tests in my project as well.
When I run vite build
it seems to be compiling and bundling my test files. I have some stubbed out tests that I plan to get to with some compiling errors right now.
Example when I run yarn build
which has tsc && vite build
> yarn build
yarn run v1.22.17
warning package.json: No license field
$ tsc && vite build
src/core/utils/numberUtils.spec.ts:1:1 - error TS1208: 'numberUtils.spec.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module.
1 describe('numberUtils - ', () => {
~~~~~~~~
Found 1 error.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Looking at it a little more, it's actually Typescript that is throwing the errors when I run tsc
, though I still am unsure if Vite is bundling it.
How do I fix tsc
errors when using vite?