Skip to content

Commit 0e3225b

Browse files
authored
build: improve build conf and dist (#272)
* build: improve build conf and dist * build: update output path * build: add umd build conf * build: refactor build command and fix resolver output
1 parent 96c235f commit 0e3225b

File tree

6 files changed

+268
-264
lines changed

6 files changed

+268
-264
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
node_modules
22
/dist
3+
/es
4+
/lib
5+
/typings
6+
/resolver-dist
37
.dumi/tmp
48
.dumi/tmp-test
59
.dumi/tmp-production

package.json

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
"vue"
1414
],
1515
"scripts": {
16-
"build": "vite build && vue-tsc --project ./tsconfig.build.json && tsc resolver/index.ts --outDir dist/resolver --declaration",
16+
"build": "npm run build:es && npm run build:umd && npm run build:resolver",
17+
"build:es": "vite build && vue-tsc --project ./tsconfig.build.json",
18+
"build:umd": "vite build --config ./vite.config.umd.mts && vue-tsc --project ./tsconfig.build.json",
19+
"build:resolver": "tsc resolver/index.ts --outDir resolver-dist --declaration",
1720
"build:watch": "vite build --watch",
1821
"docs:dev": "vitepress dev docs",
1922
"docs:build": "vitepress build docs",
@@ -38,22 +41,26 @@
3841
"license": "MIT",
3942
"exports": {
4043
".": {
41-
"types": "./dist/typings/index.d.ts",
42-
"import": "./dist/index.mjs",
43-
"require": "./dist/index.umd.js"
44+
"types": "./typings/index.d.ts",
45+
"import": "./es/index.mjs",
46+
"require": "./lib/index.js"
4447
},
4548
"./dist/style.css": "./dist/style.css",
4649
"./resolver": {
47-
"types": "./dist/resolver/index.d.ts",
48-
"import": "./dist/resolver/index.js"
50+
"types": "./resolver-dist/index.d.ts",
51+
"import": "./resolver-dist/index.js"
4952
}
5053
},
51-
"main": "./dist/index.umd.js",
52-
"module": "./dist/index.mjs",
53-
"unpkg": "dist/index.umd.js",
54-
"types": "./dist/typings/index.d.ts",
54+
"main": "./lib/index.js",
55+
"module": "./es/index.mjs",
56+
"unpkg": "./dist/index.umd.js",
57+
"types": "./typings/index.d.ts",
5558
"files": [
56-
"dist"
59+
"es",
60+
"lib",
61+
"dist",
62+
"typings",
63+
"resolver-dist"
5764
],
5865
"commitlint": {
5966
"extends": [
@@ -106,6 +113,7 @@
106113
"eslint": "^8.57.1",
107114
"eslint-plugin-vue": "^9.17.0",
108115
"fast-glob": "^3.3.2",
116+
"glob": "^11.0.1",
109117
"happy-dom": "^15.7.4",
110118
"husky": "^8.0.1",
111119
"less": "^4.2.0",
@@ -118,7 +126,7 @@
118126
"stylelint": "^14.9.1",
119127
"typescript": "~5.8.0",
120128
"unplugin-vue-macros": "^2.14.5",
121-
"vite": "^5.4.8",
129+
"vite": "^6.2.0",
122130
"vite-plugin-inspect": "^0.8.9",
123131
"vitepress": "^1.5.0",
124132
"vitest": "^2.1.1",

0 commit comments

Comments
 (0)