From 175db9bb174f0494928ee59a33f67a082f617639 Mon Sep 17 00:00:00 2001 From: Ou Date: Sun, 20 Oct 2024 20:29:08 +0800 Subject: [PATCH] chore: add typecheck --- .gitignore | 3 ++- package.json | 3 ++- vite.config.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 51bebfa..bc1a548 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ dist/ .wrangler .env .env.* -dev-dist \ No newline at end of file +dev-dist +*.tsbuildinfo \ No newline at end of file diff --git a/package.json b/package.json index da21d18..015fc16 100644 --- a/package.json +++ b/package.json @@ -13,12 +13,13 @@ "homepage": "https://github.com/ourongxing/newsnow", "scripts": { "dev": "vite dev", - "build": "vite build", + "build": "nr typecheck && vite build", "lint": "eslint", "favicon": "tsx ./scripts/favicon.ts", "start": "PORT=4444 node --env-file .env.server dist/output/server/index.mjs", "preview": "CF_PAGES=1 pnpm run build && wrangler pages dev", "deploy": "CF_PAGES=1 pnpm run build && wrangler pages deploy", + "typecheck": "tsc --noEmit -p tsconfig.node.json && tsc --noEmit -p tsconfig.app.json", "release": "bumpp", "prepare": "simple-git-hooks", "log": "wrangler pages deployment tail --project-name newsnow", diff --git a/vite.config.ts b/vite.config.ts index 684b8aa..c5ce59c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,9 +12,9 @@ import { VitePWA } from "vite-plugin-pwa" import { projectDir } from "./shared/dir" const isCF = process.env.CF_PAGES + dotenv.config({ path: join(projectDir, ".env.server"), - }) const pwaOption: Partial = {