package.json 連接和配置所有的工具和依賴。以下說明可以幫助你理解和最大化利用arkhi的配置
透過 npm
可以執行腳本
dev
:prod
build
build:arkhi
server
server:prod
專案在運行時需要的依賴。包括框架(如 React)、工具庫、API 客戶端等
特別要注意的依賴包括:
module
,表示在程式中使用 ECMAScript
模組語法(import/export)//package.json
{
"name": "arkhi",
"description": "Islands architecture based meta framework",
"scripts": {
"dev": "npm run server",
"prod": "npm run build && npm run server:prod",
"build": "vite build",
"build:arkhi": "npm run build -w ./arkhi",
"server": "ts-node server.ts",
"server:prod": "cross-env NODE_ENV=production ts-node server.ts"
},
"dependencies": {
"@mdx-js/mdx": "^2.3.0",
"@trpc/client": "^10.37.1",
"@trpc/server": "^10.37.1",
"@types/compression": "^1.7.2",
"@types/node": "^18.11.9",
"@types/react": "^18.0.8",
"@types/react-dom": "^18.0.3",
"@vitejs/plugin-react": "^3.0.0",
"compression": "^1.7.4",
"cross-env": "^7.0.3",
"express": "^4.18.1",
"gray-matter": "^4.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sirv": "^2.0.2",
"superjson": "^1.13.1",
"ts-node": "^10.9.1",
"typescript": "^4.9.4",
"vike": "^0.4.92",
"vite": "^4.0.3",
"zod": "^3.22.2"
},
"license": "MIT",
"type": "module",
"devDependencies": {
"@types/express": "^4.17.18"
},
"workspaces": [
"arkhi"
]
}