Skip to content

Commit 27a2462

Browse files
committed
fix: update mjs
Signed-off-by: Innei <[email protected]>
1 parent 003c59d commit 27a2462

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tsconfig.json

-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
"node_modules/*",
3636
"lib/*",
3737
"example/*",
38-
"vitest.config.ts",
39-
"vite.config.ts",
4038
"tailwind.config.ts",
4139
"demo/*"
4240
]

vite.config.ts vite.config.mts

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { readFileSync, writeFileSync } from 'fs'
22
import { resolve } from 'path'
3+
import { fileURLToPath } from 'url'
34
import react from '@vitejs/plugin-react'
45
import { preserveDirectives } from 'rollup-plugin-preserve-directives'
56
import { defineConfig } from 'vite'
@@ -9,15 +10,19 @@ const packageJson = JSON.parse(
910
readFileSync('./package.json', { encoding: 'utf-8' }),
1011
)
1112

13+
const __dirname = fileURLToPath(new URL('.', import.meta.url))
14+
1215
const globals = {
1316
// @ts-ignore
1417
...(packageJson?.dependencies || {}),
1518
}
19+
// eslint-disable-next-line import/no-default-export
1620
export default defineConfig({
1721
plugins: [
1822
react(),
1923
dts({
2024
// rollupTypes: true
25+
insertTypesEntry: true,
2126

2227
beforeWriteFile: (filePath, content) => {
2328
writeFileSync(filePath.replace('.d.ts', '.d.mts'), content)

0 commit comments

Comments
 (0)