Skip to content

Commit c19dd44

Browse files
committed
fix: better type declarations
1 parent b4bc729 commit c19dd44

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
],
1818
"scripts": {
1919
"build": "next build",
20+
"build:declarations": "tsc --project tsconfig.declarations.json",
2021
"prebuild:dist": "rimraf dist/**",
21-
"build:dist": "npm run build:postcss && npm run build:microbundle",
22+
"build:dist": "npm run build:postcss && npm run build:microbundle && npm run build:declarations",
2223
"build:microbundle": "NODE_ENV=production microbundle --define process.env.NODE_ENV=production --tsconfig tsconfig.microbundle.json -f cjs,es,modern --css-modules false --jsx React.createElement --jsxFragment React.Fragment",
2324
"build:postcss": "postcss -d dist src/style.css",
2425
"dev": "next",

tsconfig.declarations.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "dist",
5+
"emitDeclarationOnly": true,
6+
"declaration": true,
7+
"noEmit": false
8+
},
9+
"include": ["src"]
10+
}

tsconfig.microbundle.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"compilerOptions": {
33
"allowSyntheticDefaultImports": true,
44
"module": "ESNext",
5-
"target": "ESNext"
5+
"target": "ESNext",
6+
"declaration": false
67
}
78
}

0 commit comments

Comments
 (0)