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

feat: allow not passing a config #59

Closed
wants to merge 1 commit into from

Conversation

kecrily
Copy link

@kecrily kecrily commented Sep 5, 2022

No need to pass in the empty object to the configuration again

Copy link
Owner

@posva posva left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -15,7 +15,7 @@ import { join } from 'pathe'

export { Options }

export default createUnplugin<Options>((opt, meta) => {
export default createUnplugin<Options>((opt = {}, meta) => {
Copy link
Owner

Choose a reason for hiding this comment

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

shouldn't we do

Suggested change
export default createUnplugin<Options>((opt = {}, meta) => {
export default createUnplugin<Options | undefined>((opt = {}, meta) => {

and avoid changing al the src/*.ts entry files like esbuild, rollup, etc

Copy link
Owner

Choose a reason for hiding this comment

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

yeah, it seems like this would create the correct type: https://github.com/unjs/unplugin/blob/main/src/types.ts#L69-L71

@posva posva changed the title fix: no config needed, out of the box feat: allow not passing a config Sep 17, 2022
@posva posva closed this in 80fd444 Sep 30, 2022
@posva
Copy link
Owner

posva commented Sep 30, 2022

Thanks! I added you to 80fd444

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.

None yet

2 participants