-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
feat(dynamic-import-vars): Error when no files found #1611
Conversation
Hey thanks for the PR. This makes sense. This only caveat is that this hasn't been an error for a very long time. Given that the Vite ecosystem uses this plugin heavily (and will for some time to come yet), I'd like to take this in a slightly different route: hide this behind an option, which is defaulted to |
339dcee
to
321a9a3
Compare
Yup that's fair enough. I've moved this to be behind a option. Let me know what you think :) |
Hey @shellscape; pinging you in case you don't get notifications for this. No rush though 😄 |
Added the documentation we'd need for the new option to the README and updated the types. Something to keep in mind that we need for new features for the future. Thanks for the work on this one. |
* Add test for throwing if there are no files found * Throw error if no files were found * update error message with more context * chore: update readme and types --------- Co-authored-by: shellscape <[email protected]>
* Add test for throwing if there are no files found * Throw error if no files were found * update error message with more context * chore: update readme and types --------- Co-authored-by: shellscape <[email protected]>
* Add test for throwing if there are no files found * Throw error if no files were found * update error message with more context * chore: update readme and types --------- Co-authored-by: shellscape <[email protected]>
* Add test for throwing if there are no files found * Throw error if no files were found * update error message with more context * chore: update readme and types --------- Co-authored-by: shellscape <[email protected]>
* Add test for throwing if there are no files found * Throw error if no files were found * update error message with more context * chore: update readme and types --------- Co-authored-by: shellscape <[email protected]>
* Add test for throwing if there are no files found * Throw error if no files were found * update error message with more context * chore: update readme and types --------- Co-authored-by: shellscape <[email protected]>
* Add test for throwing if there are no files found * Throw error if no files were found * update error message with more context * chore: update readme and types --------- Co-authored-by: shellscape <[email protected]>
* Add test for throwing if there are no files found * Throw error if no files were found * update error message with more context * chore: update readme and types --------- Co-authored-by: shellscape <[email protected]>
Cheers! I'll keep that in mind for next time :) |
Rollup Plugin Name:
dynamic-import-vars
This PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
Description
Hey hey! I'd like the
dynamic-import-vars
to error if there are no files found. I think this makes sense since the function would also error on runtime since it's just a function with a switch statement that defaults to throwing a runtime error.Example dynamic import runtime function when there are no files in the directory.
I made this a breaking change but I can put this behind a option instead if we'd like. I think having it on by default makes a lot of sense again because this would already result in a runtime error anyways.