Skip to content

Commit

Permalink
rollup: emit typescript .d.ts files
Browse files Browse the repository at this point in the history
Note that currently a rootDir needs to be specified in tsconfig.json,
see rollup/plugins#61 (comment)
  • Loading branch information
danimoh committed Mar 5, 2020
1 parent 0ae28f2 commit 8d56cfd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ export default {
input: 'src/low-level-api/low-level-api.ts',
output: [
{
dir: 'dist/module',
dir: 'dist', // not dist/low-level-api as ts plugin creates sub folder structure in dist as in rootDir
format: "es",
entryFileNames: 'low-level-api/[name].[format].js',
sourcemap: true
},
{
dir: 'dist/commonjs',
dir: 'dist',
format: 'cjs',
entryFileNames: 'low-level-api/[name].[format].js',
sourcemap: true
}
],
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"esModuleInterop": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true
"noImplicitThis": true,
"declaration": true,
"declarationDir": "dist",
"rootDir": "src"
}
}

0 comments on commit 8d56cfd

Please sign in to comment.