question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why does the plugin write declaration files directly? vs using `emitFile`

See original GitHub issue

As opposed to using emitFile on the rollup context?

The main issue I’m running into is that declarations aren’t emitted at all when using the rollup API directly, because that calls the generateBundle hook with isWrite==false. But more generally, it would be useful to have these in the return value from generate, so that I can feed them into a .d.ts bundling tool.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
ezolenkocommented, Oct 10, 2019

I think this API didn’t exist when the plugin was originally written (or I missed it completely). This does make a lot of sense though, feel free to make a PR. (If not, I’ll fix it, eventually 😃).

1reaction
marijnhcommented, Oct 18, 2019

This is apparently not intentional behavior in Rollup, see https://github.com/rollup/rollup/issues/3174

Read more comments on GitHub >

github_iconTop Results From Across the Web

rollup.js
Using the --configPlugin option will always force your config file to be transpiled to CommonJS first. ... Export a value immediately upon declaration:...
Read more >
Writing a custom webpack loader - Redd Developer
Excel your webpack knowledge by learning how to write a custom webpack loader that turns an MP3 file import into an interactive audio ......
Read more >
TypeScript library tips: Rollup your types! | by Martin Hochel
NOTE: this article will not go through how to configure Rollup or how it works in detail ... (type declaration files emitted by...
Read more >
Introduction
Rollup can import existing CommonJS modules through a plugin. ... To use Rollup with a configuration file, pass the --config or -c flags:...
Read more >
Plugin API
As a result, you can write a Vite plugin once and have it work for both dev ... This exposes the plugin to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found