Skip to content

Commit

Permalink
tsc: Pass -b flag so that vite.config.ts is type checked
Browse files Browse the repository at this point in the history
It highlighted the following error:

    [philbates@fedora laravel-starter]$ pnpm run build

    > @ build /home/philbates/code/philbates35/laravel-starter
    > tsc -b && vite build

    vite.config.ts:33:20 - error TS2461: Type 'string[] | undefined' is not an array type.

    33       exclude: [...configDefaults.coverage.exclude, ...projectExcludes],
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Found 1 error.
  • Loading branch information
philbates35 committed Feb 14, 2024
1 parent 1b89446 commit 2aa6462
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build": "tsc -b && vite build",
"test": "vitest",
"coverage": "vitest run --coverage",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default defineConfig({
exclude: [...configDefaults.exclude, ...projectExcludes],
coverage: {
provider: "v8",
exclude: [...configDefaults.coverage.exclude, ...projectExcludes],
exclude: [...(configDefaults.coverage.exclude ?? []), ...projectExcludes],
},
setupFiles: ["resources/js/setupFile.ts"],
},
Expand Down

0 comments on commit 2aa6462

Please sign in to comment.