Skip to content

Commit a33adfd

Browse files
committed
chore: add type generation
1 parent 4905709 commit a33adfd

File tree

6 files changed

+7
-4
lines changed

6 files changed

+7
-4
lines changed
File renamed without changes.

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
],
99
"main": "./dist/vue-local-scope.umd.cjs",
1010
"module": "./dist/vue-local-scope.js",
11+
"types": "./dist/vue-local-scope.d.ts",
1112
"exports": {
1213
".": {
1314
"import": "./dist/vue-local-scope.js",
@@ -26,7 +27,8 @@
2627
],
2728
"scripts": {
2829
"dev": "vite",
29-
"build": "vue-tsc -b && vite build",
30+
"build": "vue-tsc -b && vite build && npm run generate-types",
31+
"generate-types": "vue-tsc lib/vue-local-scope.ts --declaration --emitDeclarationOnly --outDir dist",
3032
"preview": "vite preview",
3133
"test": "vue-tsc -b"
3234
},

src/demo-sfc.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts" generic="T">
2-
import { LocalScope } from "../lib";
2+
import { LocalScope } from "../lib/vue-local-scope";
33
44
defineProps<{ lorem: string }>();
55
</script>

src/demo-tsx.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineComponent } from "vue";
2-
import { LocalScope } from "../lib";
2+
import { LocalScope } from "../lib/vue-local-scope";
33

44
export default defineComponent((props: { lorem: string }) => {
55
return () => (

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default defineConfig({
88
plugins: [vue(), vueJsx()],
99
build: {
1010
lib: {
11-
entry: resolve(__dirname, "lib/index.ts"),
11+
entry: resolve(__dirname, "lib/vue-local-scope.ts"),
1212
name: "VueLocalScope",
1313
fileName: "vue-local-scope",
1414
},

0 commit comments

Comments
 (0)