Skip to content

Commit

Permalink
fix: update mjs
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Mar 18, 2024
1 parent 003c59d commit 27a2462
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
"node_modules/*",
"lib/*",
"example/*",
"vitest.config.ts",
"vite.config.ts",
"tailwind.config.ts",
"demo/*"
]
Expand Down
5 changes: 5 additions & 0 deletions vite.config.ts → vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { readFileSync, writeFileSync } from 'fs'
import { resolve } from 'path'
import { fileURLToPath } from 'url'
import react from '@vitejs/plugin-react'
import { preserveDirectives } from 'rollup-plugin-preserve-directives'
import { defineConfig } from 'vite'
Expand All @@ -9,15 +10,19 @@ const packageJson = JSON.parse(
readFileSync('./package.json', { encoding: 'utf-8' }),
)

const __dirname = fileURLToPath(new URL('.', import.meta.url))

const globals = {
// @ts-ignore
...(packageJson?.dependencies || {}),
}
// eslint-disable-next-line import/no-default-export
export default defineConfig({
plugins: [
react(),
dts({
// rollupTypes: true
insertTypesEntry: true,

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

0 comments on commit 27a2462

Please sign in to comment.