Any way to move "The following packages did not export their `package.json`" warning to onwarn?
See original GitHub issueGetting the “The following packages did not export their package.json
” warning importing a package. I requested a PR for that package and owner closed it saying bundlers should use fs
to read the package.json instead.
Regardless of the owner being right or not, is there any reason why this one has to be done with console.warn and not part of onwarn
warnings? All warnings should be suppressible so users can suppress them once they see it and deemed not important.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:14 (5 by maintainers)
Top Results From Across the Web
"rollup-plugin-svelte" The following packages did not export ...
It's emitted because some modules specify the files they're exporting in package.json using the exports field, but they don't include package.
Read more >[rollup-plugin-svelte] The following packages did not export ...
[rollup-plugin-svelte] The following packages did not export their `package.json` file so we could not check the "svelte" field.
Read more >rollup.js
You will only get a default export from CommonJS plugins. You may not be able to import JSON files such as your package.json...
Read more >Setting Up a JavaScript Build Process using Rollup
We can then initialise a node project by typing the next command and following the instructions: npm init. It will create a package.json...
Read more >rollup.js
If your package.json file also has a module field, ES-module-aware tools like Rollup and ... In that way, they behave similarly to const...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m ok with rollup-plugin-svelte not trying to do more to handle other packages not exporting their package.json. I guess all I would be looking for is some configuration (e.g. in rollup.config.js) where we can list the libraries to skip the warning for. Essentially a way to say “yep, I’ve seen the warning. Now stop showing it to me for this library” 😃
We will probably remove
pkg.svelte
which will end up solving this. However, we’ll need to introduce a warning about the upcoming behavior change for a period of time first for packages where that would change how the package is resolved.