Skip to content

Commit

Permalink
fix: better type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Dec 8, 2020
1 parent b4bc729 commit c19dd44
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
],
"scripts": {
"build": "next build",
"build:declarations": "tsc --project tsconfig.declarations.json",
"prebuild:dist": "rimraf dist/**",
"build:dist": "npm run build:postcss && npm run build:microbundle",
"build:dist": "npm run build:postcss && npm run build:microbundle && npm run build:declarations",
"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",
"build:postcss": "postcss -d dist src/style.css",
"dev": "next",
Expand Down
10 changes: 10 additions & 0 deletions tsconfig.declarations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"emitDeclarationOnly": true,
"declaration": true,
"noEmit": false
},
"include": ["src"]
}
3 changes: 2 additions & 1 deletion tsconfig.microbundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"module": "ESNext",
"target": "ESNext"
"target": "ESNext",
"declaration": false
}
}

0 comments on commit c19dd44

Please sign in to comment.