Skip to content

Commit 4edf06b

Browse files
committed
fix(react-qr-code): correct .d.ts emit with TypeScript 6
Disable vite-plugin-dts rollupTypes (API Extractor uses an older TS and produced an empty declaration bundle). Point types and exports to ./dist/src/index.d.ts where declarations are emitted. Made-with: Cursor
1 parent 3216427 commit 4edf06b

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

packages/react-qr-code/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
"scripts": {
3434
"build": "tsc -b && vite build"
3535
},
36-
"types": "./dist/index.d.ts",
36+
"types": "./dist/src/index.d.ts",
3737
"main": "./dist/index.es.js",
3838
"module": "./dist/index.es.js",
3939
"exports": {
4040
".": {
4141
"import": "./dist/index.es.js",
42-
"types": "./dist/index.d.ts"
42+
"types": "./dist/src/index.d.ts"
4343
}
4444
},
4545
"files": [

packages/react-qr-code/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const __dirname = dirname(fileURLToPath(import.meta.url))
1010
export default defineConfig({
1111
plugins: [
1212
dts({
13-
rollupTypes: true,
13+
// rollupTypes uses API Extractor with an older bundled TS than the project (TS 6); it emitted empty `export { }`.
14+
rollupTypes: false,
1415
}),
1516
],
1617
build: {

0 commit comments

Comments
 (0)