Skip to content

Commit 27fa701

Browse files
authored
Merge pull request #134 from permafrost-dev/add-typescript-defs
Add typescript definitions
2 parents ba71352 + fcfbd80 commit 27fa701

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

package.json

Lines changed: 13 additions & 6 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": {
@@ -35,9 +39,11 @@
3539
"lint:fix": "./node_modules/.bin/eslint --ext ts,js --fix src/",
3640
"lint:staged": "./node_modules/.bin/lint-staged",
3741
"fix": "npm run fmt && npm run lint:fix",
38-
"build:vue2": "rollup --config rollup.vue2-config.js",
39-
"build:vue3": "rollup --config rollup.vue3-config.js",
40-
"build:all": "concurrently npm:build:vue2 npm:build:vue3",
42+
"build:vue2": "rollup --config rollup.vue2-config.js --bundleConfigAsCjs",
43+
"build:vue3": "rollup --config rollup.vue3-config.js --bundleConfigAsCjs",
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)