Skip to content

Commit 7d6113d

Browse files
committed
chore: improve Typescript configuration
1 parent 4edda0b commit 7d6113d

File tree

15 files changed

+516
-8
lines changed

15 files changed

+516
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ dist
33
*.log
44
.DS_Store
55
.idea/
6+
tsconfig.tsbuildinfo

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"typescript": "^5.9.3",
6868
"typescript-eslint": "^8.46.1",
6969
"vite": "npm:rolldown-vite@latest",
70+
"vite-plugin-tsconfig-paths": "^1.4.1",
7071
"vitest": "^3.2.4"
7172
}
7273
}

playground/src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// import { MyButton } from '../../dist'
21
import { MyButton } from '../../src'
32

43
export function App() {

playground/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { StrictMode } from 'react'
22
import { createRoot } from 'react-dom/client'
3-
import { App } from './App.tsx'
3+
import { App } from './App'
44
import './style.css'
55

66
createRoot(document.querySelector('#app')!).render(

playground/tsconfig.app.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"tsBuildInfoFile": "../node_modules/.tmp/tsconfig.playground.app.tsbuildinfo",
5+
"target": "ES2023",
6+
"module": "ESNext",
7+
"moduleResolution": "bundler",
8+
"types": [
9+
"vite/client"
10+
]
11+
},
12+
"include": [
13+
"./src",
14+
"../src"
15+
]
16+
}

playground/tsconfig.node.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"tsBuildInfoFile": "../node_modules/.tmp/tsconfig.playground.node.tsbuildinfo",
5+
"module": "ESNext",
6+
"moduleResolution": "nodenext",
7+
},
8+
"include": [
9+
"vite.config.ts"
10+
]
11+
}

playground/vite.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import react from '@vitejs/plugin-react'
22
import { defineConfig } from 'vite'
33
import tailwindcss from '@tailwindcss/vite'
4+
import tsConfigPaths from 'vite-plugin-tsconfig-paths';
45

56
export default defineConfig({
67
root: './playground',
78
plugins: [
89
react(),
9-
tailwindcss()
10+
tailwindcss(),
11+
tsConfigPaths()
1012
],
1113
})

0 commit comments

Comments
 (0)