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

Conversation

davidlj95
Copy link
Owner

Proposed changes

Uses rollup-plugin-dts to generated bundled Typescript definition files. Why we need those? See #411

Eventually this was discarded in favour of #414 as the plugin is in maintenance mode since July 2023

Quick reminders

  • 🤝 I will follow Code of Conduct
  • No existing pull request already does almost same changes
  • 👁️ Contributing docs are something I've taken a look at
  • 📝 Commit messages convention has been followed
  • 💬 TSDoc comments have been added or updated indicating API visibility if API surface has changed.
  • 🧪 Tests have been added if needed. For instance, if adding new features or fixing a bug. Or removed if removing features.
  • ⚙️ API Report has been updated if API surface is altered.

Relates to issue #411

Copy link
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @davidlj95 and the rest of your teammates on Graphite Graphite

Comment on lines +5 to +9
input: 'projects/ngx-meta/dist/json-ld/index.d.ts',
output: {
format: 'es',
file: 'projects/ngx-meta/dist/json-ld/bundled.d.ts',
},
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.

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

@davidlj95 davidlj95 force-pushed the stacked/fix-use-rollup-plugin-dts-to-rollup-TS-defs branch from 1aaf3d3 to 00389ea Compare March 10, 2024 01:21
@davidlj95 davidlj95 closed this Mar 10, 2024
@davidlj95 davidlj95 deleted the stacked/fix-use-rollup-plugin-dts-to-rollup-TS-defs branch March 10, 2024 01:21
Copy link

📦 Bundle size (Angular v15)

Git ref: 00389eac0218b072520a7f89072b64afef758d9e

Module file Size Base size Difference
ngx-meta-core.mjs 3460 bytes (3.4KiB) 3460 bytes (3.4KiB) No change
ngx-meta-json-ld.mjs 392 bytes (392B) 392 bytes (392B) No change
ngx-meta-open-graph.mjs 1227 bytes (1.2KiB) 1227 bytes (1.2KiB) No change
ngx-meta-routing.mjs 1015 bytes (1015B) 1015 bytes (1015B) No change
ngx-meta-standard.mjs 885 bytes (885B) 885 bytes (885B) No change
ngx-meta-twitter-card.mjs 648 bytes (648B) 648 bytes (648B) No change
Total 7627 bytes (7.5KiB) 7627 bytes (7.5KiB) No change

Copy link

📦 Bundle size (Angular v16)

Git ref: 00389eac0218b072520a7f89072b64afef758d9e

Module file Size Base size Difference
ngx-meta-core.mjs 3460 bytes (3.4KiB) 3460 bytes (3.4KiB) No change
ngx-meta-json-ld.mjs 392 bytes (392B) 392 bytes (392B) No change
ngx-meta-open-graph.mjs 1227 bytes (1.2KiB) 1227 bytes (1.2KiB) No change
ngx-meta-routing.mjs 1015 bytes (1015B) 1015 bytes (1015B) No change
ngx-meta-standard.mjs 885 bytes (885B) 885 bytes (885B) No change
ngx-meta-twitter-card.mjs 648 bytes (648B) 648 bytes (648B) No change
Total 7627 bytes (7.5KiB) 7627 bytes (7.5KiB) No change

Copy link

📦 Bundle size (Angular v17)

Git ref: 00389eac0218b072520a7f89072b64afef758d9e

Module file Size Base size Difference
ngx-meta-core.mjs 3048 bytes (3.0KiB) 3048 bytes (3.0KiB) No change
ngx-meta-json-ld.mjs 226 bytes (226B) 226 bytes (226B) No change
ngx-meta-open-graph.mjs 888 bytes (888B) 888 bytes (888B) No change
ngx-meta-routing.mjs 839 bytes (839B) 839 bytes (839B) No change
ngx-meta-standard.mjs 768 bytes (768B) 768 bytes (768B) No change
ngx-meta-twitter-card.mjs 488 bytes (488B) 488 bytes (488B) No change
Total 6257 bytes (6.2KiB) 6257 bytes (6.2KiB) No change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant