Skip to content

Commit 628c74c

Browse files
committed
Add typescript definitions to build process for Vue2 and Vue3Added typescript definitions generation to build process for Vue2 and Vue3 using the dts-bundle-generator package
1 parent ba71352 commit 628c74c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,22 @@
1313
"url": "https://github.com/permafrost-dev/vue-ray/issues"
1414
},
1515
"main": "./dist/vue3.cjs.js",
16+
"typings": "./dist/vue3.d.ts",
1617
"exports": {
1718
".": {
1819
"import": "./dist/vue3.mjs",
19-
"require": "./dist/vue3.cjs.js"
20+
"require": "./dist/vue3.cjs.js",
21+
"types": "./dist/vue3.d.ts"
2022
},
2123
"./vue2": {
2224
"import": "./dist/vue2.mjs",
23-
"require": "./dist/vue2.cjs.js"
25+
"require": "./dist/vue2.cjs.js",
26+
"types": "./dist/vue2.d.ts"
2427
},
2528
"./vue3": {
2629
"import": "./dist/vue3.mjs",
27-
"require": "./dist/vue3.cjs.js"
30+
"require": "./dist/vue3.cjs.js",
31+
"types": "./dist/vue3.d.ts"
2832
}
2933
},
3034
"scripts": {
@@ -37,7 +41,9 @@
3741
"fix": "npm run fmt && npm run lint:fix",
3842
"build:vue2": "rollup --config rollup.vue2-config.js",
3943
"build:vue3": "rollup --config rollup.vue3-config.js",
40-
"build:all": "concurrently npm:build:vue2 npm:build:vue3",
44+
"build:dts:vue2": "./node_modules/.bin/dts-bundle-generator -o ./dist/vue2.d.ts src/RayVue2.ts",
45+
"build:dts:vue3": "./node_modules/.bin/dts-bundle-generator -o ./dist/vue2.d.ts src/RayVue2.ts",
46+
"build:all": "concurrently npm:build:vue2 npm:build:vue3 && concurrently npm:build:dts:vue2 npm:build:dts:vue3",
4147
"preversion": "npm run test",
4248
"postversion": "npm run build:all",
4349
"prepare": "husky install"
@@ -72,6 +78,7 @@
7278
"@typescript-eslint/eslint-plugin": "^5.59.6",
7379
"@typescript-eslint/parser": "^5.59.6",
7480
"concurrently": "^8.0.1",
81+
"dts-bundle-generator": "^8.0.1",
7582
"eslint": "^8.40.0",
7683
"husky": "^8.0.3",
7784
"jest": "^29.5.0",

0 commit comments

Comments
 (0)