Skip to content

Commit 3a0a55a

Browse files
authoredJul 30, 2024··
fix: build / type declarations (#9)
* fix type declarations * cleanup
1 parent 74935a0 commit 3a0a55a

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed
 

‎index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from "./src/hooks";
2+
import { plugin } from "./src/plugin";
3+
export default plugin;

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"type": "module",
66
"main": "dist/index.js",
77
"module": "dist/index.mjs",
8+
"types": "dist/types/index.d.ts",
89
"scripts": {
910
"dev": "vite",
1011
"size": "size-limit",

‎rollup.config.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import typescript from 'rollup-plugin-typescript2';
2-
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
2+
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
33
import terser from '@rollup/plugin-terser';
44
import del from 'rollup-plugin-delete';
55
import { nodeResolve } from '@rollup/plugin-node-resolve';
66
import commonjs from '@rollup/plugin-commonjs';
77

88
export default [
99
{
10-
input: 'src/index.ts',
10+
input: 'index.ts',
1111
output: [
1212
{
1313
format: 'esm',
@@ -30,14 +30,17 @@ export default [
3030
typescript({
3131
tsconfig: 'tsconfig.node.json',
3232
check: false,
33+
useTsconfigDeclarationDir: true,
3334
tsconfigOverride: {
3435
compilerOptions: {
3536
sourceMap: true,
3637
declaration: true,
3738
declarationMap: true,
39+
target: "ESNext",
40+
declarationDir: "./dist/types",
3841
}
3942
}
4043
})
4144
]
4245
}
43-
]
46+
];

‎src/App.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { useTelemetryDeck } from "./"
2+
import { useTelemetryDeck } from "../index.ts";
33
const { signal, queue, setClientUser } = useTelemetryDeck();
44
55
const changeClientUserClick = () => {

‎src/index.ts

-3
This file was deleted.

‎src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createApp } from 'vue'
22
import './style.css'
33
import App from './App.vue'
4-
import TelemetryDeckPlugin from './'
4+
import TelemetryDeckPlugin from '../index.ts'
55

66
const app = createApp(App)
77
app.use(TelemetryDeckPlugin, {

0 commit comments

Comments
 (0)
Please sign in to comment.