Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use rollup-plugin-dts to rollup TS defs #415

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

19 changes: 19 additions & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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',
},
Comment on lines +5 to +9
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd have to see if the plugin supports multiple inputs & output files by name. Some quick tests seemed to indicate it doesn't. So the other alternative would be to call rollup using it's JS API.

plugins: [
dts({
respectExternal: true,
}),
],
external: [/node_modules/, /ngx-meta\/dist\/(?!json-ld)/],
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore references to other ngx-meta entry points, those definitions will be bundled as part of those entry points

},
]

export default config