v0.6.1: 改为编译 ship,通过 npm prepare hook 自动构建
- 加 tsconfig.build.json,排除 test,rootDir 设为 src
- package.json: main/types/exports 指向 dist/main/index.{js,d.ts}
- prepare hook: 消费侧 git 安装后自动 tsc,产物不进 git
- 解决消费侧 "tsc + 裸 node" 链路 (theseus-server 等) 找不到 .js 的问题
This commit is contained in:
+8
-6
@@ -1,22 +1,24 @@
|
||||
{
|
||||
"name": "shrimp-server",
|
||||
"version": "0.6.0",
|
||||
"private": true,
|
||||
"version": "0.6.1",
|
||||
"description": "Shrimp 框架后端 — 声明式字段驱动的 Node.js 管理后台框架(Express + Mongoose + JWT)",
|
||||
"main": "src/main/index.ts",
|
||||
"types": "src/main/index.ts",
|
||||
"main": "dist/main/index.js",
|
||||
"types": "dist/main/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./src/main/index.ts",
|
||||
"default": "./src/main/index.ts"
|
||||
"types": "./dist/main/index.d.ts",
|
||||
"default": "./dist/main/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"src",
|
||||
"README.md"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.build.json",
|
||||
"prepare": "tsc -p tsconfig.build.json",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"typecheck": "tsc --noEmit"
|
||||
|
||||
Reference in New Issue
Block a user