Skip to content

Commit

Permalink
fix: use rollup-plugin-dts to rollup TS defs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlj95 committed Mar 8, 2024
1 parent b312362 commit 1aaf3d3
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 51 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
"ng-mocks": "14.12.1",
"ng-packagr": "17.2.1",
"prettier": "3.2.5",
"rollup": "4.12.1",
"rollup-plugin-dts": "6.1.0",
"semantic-release": "23.0.2",
"typescript": "5.2.2"
}
Expand Down
139 changes: 88 additions & 51 deletions pnpm-lock.yaml

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

20 changes: 20 additions & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { dts } from 'rollup-plugin-dts'

const config = [
{
input: 'projects/ngx-meta/dist/json-ld/index.d.ts',
output: {
format: 'es',
file: 'projects/ngx-meta/dist/json-ld/bundled.d.ts',
},
plugins: [
dts({
tsconfig: './tsconfig.rollup.json',
respectExternal: true,
}),
],
external: [/node_modules/, /ngx-meta\/dist\/(?!json-ld)/],
},
]

export default config
12 changes: 12 additions & 0 deletions tsconfig.rollup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"paths": {
// 👇 Changed to add secondary entry points
// "ngx-meta": ["./dist/ngx-meta"],
"@davidlj95/ngx-meta/*": ["./projects/ngx-meta/dist/*"],
"@davidlj95/ngx-meta": ["./projects/ngx-meta/dist"]
}
}
}

0 comments on commit 1aaf3d3

Please sign in to comment.