chore: add typecheck

This commit is contained in:
Ou 2024-10-20 20:29:08 +08:00
parent 63db52fb9a
commit 175db9bb17
3 changed files with 5 additions and 3 deletions

3
.gitignore vendored
View File

@ -8,4 +8,5 @@ dist/
.wrangler .wrangler
.env .env
.env.* .env.*
dev-dist dev-dist
*.tsbuildinfo

View File

@ -13,12 +13,13 @@
"homepage": "https://github.com/ourongxing/newsnow", "homepage": "https://github.com/ourongxing/newsnow",
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
"build": "vite build", "build": "nr typecheck && vite build",
"lint": "eslint", "lint": "eslint",
"favicon": "tsx ./scripts/favicon.ts", "favicon": "tsx ./scripts/favicon.ts",
"start": "PORT=4444 node --env-file .env.server dist/output/server/index.mjs", "start": "PORT=4444 node --env-file .env.server dist/output/server/index.mjs",
"preview": "CF_PAGES=1 pnpm run build && wrangler pages dev", "preview": "CF_PAGES=1 pnpm run build && wrangler pages dev",
"deploy": "CF_PAGES=1 pnpm run build && wrangler pages deploy", "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", "release": "bumpp",
"prepare": "simple-git-hooks", "prepare": "simple-git-hooks",
"log": "wrangler pages deployment tail --project-name newsnow", "log": "wrangler pages deployment tail --project-name newsnow",

View File

@ -12,9 +12,9 @@ import { VitePWA } from "vite-plugin-pwa"
import { projectDir } from "./shared/dir" import { projectDir } from "./shared/dir"
const isCF = process.env.CF_PAGES const isCF = process.env.CF_PAGES
dotenv.config({ dotenv.config({
path: join(projectDir, ".env.server"), path: join(projectDir, ".env.server"),
}) })
const pwaOption: Partial<VitePWAOptions> = { const pwaOption: Partial<VitePWAOptions> = {