Skip to content

Commit ecf4040

Browse files
committed
refactor: 给components和copyright子包增加unbuild
1 parent e09a4c6 commit ecf4040

9 files changed

Lines changed: 1302 additions & 60 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"lint:eslint": "eslint . --cache --fix",
1717
"lint:stylelint": "stylelint \"{apps,packages}/**/*.{css,scss,vue}\" --cache --fix",
1818
"preinstall": "npx only-allow pnpm",
19-
"postinstall": "simple-git-hooks",
19+
"postinstall": "pnpm -r run stub --if-present && simple-git-hooks",
2020
"taze": "taze minor -wIr",
2121
"commit": "git cz",
2222
"release": "bumpp"
@@ -45,6 +45,7 @@
4545
"taze": "catalog:",
4646
"tsx": "catalog:",
4747
"typescript": "catalog:",
48+
"unbuild": "catalog:",
4849
"unocss": "catalog:",
4950
"unocss-preset-animations": "catalog:"
5051
},
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineBuildConfig } from 'unbuild'
2+
3+
export default defineBuildConfig({
4+
entries: ['./resolver'],
5+
declaration: false,
6+
clean: true,
7+
})

packages/components/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
"version": "0.0.0",
55
"exports": {
66
".": "./index.ts",
7-
"./resolver": "./resolver.ts"
7+
"./resolver": {
8+
"types": "./resolver.ts",
9+
"import": "./dist/resolver.mjs"
10+
}
11+
},
12+
"scripts": {
13+
"stub": "pnpm unbuild --stub"
814
},
915
"peerDependencies": {
1016
"@vueuse/components": "catalog:",

packages/components/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
},
77
"include": [
88
"auto-imports.d.ts",
9+
"build.config.ts",
910
"global.d.ts",
1011
"index.ts",
1112
"resolver.ts",

packages/copyright/build.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineBuildConfig } from 'unbuild'
2+
3+
export default defineBuildConfig({
4+
entries: ['./index'],
5+
declaration: false,
6+
clean: true,
7+
})

packages/copyright/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
"type": "module",
44
"version": "0.0.0",
55
"exports": {
6-
".": "./index.ts"
6+
".": {
7+
"types": "./index.ts",
8+
"import": "./dist/index.mjs"
9+
}
10+
},
11+
"scripts": {
12+
"stub": "pnpm unbuild --stub"
713
},
814
"peerDependencies": {
915
"vite": "catalog:"

packages/copyright/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"types": ["node"]
55
},
66
"include": [
7-
"index.ts"
7+
"index.ts",
8+
"build.config.ts"
89
]
910
}

0 commit comments

Comments
 (0)