Skip to content

Commit

Permalink
Merge pull request #40 from michaeldzjap/fix/#39-type-declarations
Browse files Browse the repository at this point in the history
Let rollup typescript plugin properly generate type declaration files
  • Loading branch information
michaeldzjap authored Jan 8, 2022
2 parents 85428c6 + a88099b commit 7e77bbb
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 51 deletions.
6 changes: 0 additions & 6 deletions .npmignore

This file was deleted.

86 changes: 43 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,19 @@ const local = process.env.NODE_ENV === 'local';
export default {
input: 'src/index.ts',
output: [
{ file: pkg.main, format: 'cjs', sourcemap: local, exports: 'named' },
{ file: pkg.module, format: 'es', sourcemap: local },
{
dir: './',
entryFileNames: pkg.main,
format: 'cjs',
sourcemap: local,
exports: 'named',
},
{
dir: './',
entryFileNames: pkg.module,
format: 'es',
sourcemap: local,
},
],
external: [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {})],
watch: {
Expand All @@ -23,6 +34,9 @@ export default {
typescript({
typescript: require('typescript'),
sourceMap: local,
declaration: true,
declarationDir: 'dist/',
rootDir: 'src/',
}),
commonjs(),
nodeResolve(),
Expand Down
1 change: 1 addition & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"strict": true,
"declaration": true,
"declarationDir": "./dist",
"rootDir": "./src",
"outDir": "./dist",
"jsx": "react"
},
Expand Down

0 comments on commit 7e77bbb

Please sign in to comment.