Skip to content

Commit b76df7e

Browse files
committed
fix: fixed the useVueSonner types when build
1 parent 6224334 commit b76df7e

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

components.d.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ export {}
77
/* prettier-ignore */
88
declare module 'vue' {
99
export interface GlobalComponents {
10-
'Carbon:cafe': typeof import('~icons/carbon/cafe')['default']
11-
'Carbon:logoTwitter': typeof import('~icons/carbon/logo-twitter')['default']
1210
CheckIcon: typeof import('./src/components/icons/CheckIcon.vue')['default']
1311
CopyIcon: typeof import('./src/components/icons/CopyIcon.vue')['default']
1412
Expand: typeof import('./src/components/Expand.vue')['default']
@@ -17,7 +15,6 @@ declare module 'vue' {
1715
HeadlessToastWithProps: typeof import('./src/components/HeadlessToastWithProps.vue')['default']
1816
Hero: typeof import('./src/components/Hero.vue')['default']
1917
Installation: typeof import('./src/components/Installation.vue')['default']
20-
'Mdi:heart': typeof import('~icons/mdi/heart')['default']
2118
Others: typeof import('./src/components/Others.vue')['default']
2219
Position: typeof import('./src/components/Position.vue')['default']
2320
Styling: typeof import('./src/components/Styling.vue')['default']

packages/hooks.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ref, watchEffect } from 'vue'
1+
import { ref, watchEffect, type Ref } from 'vue'
22
import type { ToastT } from './types'
33
import { ToastState } from './state'
44

@@ -18,7 +18,9 @@ export function useIsDocumentHidden() {
1818
}
1919
}
2020

21-
export function useVueSonner() {
21+
export function useVueSonner(): {
22+
activeToasts: Ref<ToastT[]>
23+
} {
2224
const activeToasts = ref<ToastT[]>([])
2325

2426
watchEffect((onInvalidate) => {

vite.config.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ export default defineConfig(({ command, mode }) => {
4747
output: [
4848
{
4949
format: 'cjs',
50-
entryFileNames: `vue-sonner.cjs`,
50+
entryFileNames: `vue-sonner.cjs`
5151
},
5252
{
5353
format: 'es',
5454
entryFileNames: `vue-sonner.js`,
5555
preserveModules: false
56-
},
57-
],
56+
}
57+
]
5858
}
5959
}
6060
userConfig.plugins = [
@@ -63,18 +63,18 @@ export default defineConfig(({ command, mode }) => {
6363
name: 'inline-css',
6464
transform(code, id) {
6565
const isCSS = (path: string) => /\.css$/.test(path)
66-
if(!isCSS(id)) return
66+
if (!isCSS(id)) return
6767

6868
const cssCode = minify(code)
6969
cssCodeStr = cssCode
7070
return {
7171
code: '',
72-
map: { mappings: '' },
72+
map: { mappings: '' }
7373
}
7474
},
7575
renderChunk(code, { isEntry }) {
76-
if(!isEntry) return
77-
76+
if (!isEntry) return
77+
7878
return {
7979
code: `\
8080
function __insertCSSVueSonner(code) {
@@ -87,18 +87,18 @@ export default defineConfig(({ command, mode }) => {
8787
}\n
8888
__insertCSSVueSonner(${JSON.stringify(cssCodeStr)})
8989
\n ${code}`,
90-
map: { mappings: '' },
90+
map: { mappings: '' }
9191
}
92-
},
93-
},
92+
}
93+
}
9494
]
9595
}
9696

9797
return {
9898
resolve: {
9999
alias: {
100100
'@': fileURLToPath(new URL('./packages', import.meta.url)),
101-
'~': fileURLToPath(new URL('./src', import.meta.url)),
101+
'~': fileURLToPath(new URL('./src', import.meta.url))
102102
}
103103
},
104104
plugins: [...commonPlugins],

0 commit comments

Comments
 (0)