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

Allow omitting options to plugin-webpack #1047

Merged

Conversation

ralphtheninja
Copy link
Contributor

Changes

It allows the developer to omit the options object. Maybe they forgot to add the object or simply just want to use the plugin default values. Either way, they need to pass an empty object to avoid TypeError: Cannot read property 'mode' of undefined

Also tweaked the docs a bit, explaining that the options object is optional.

Before:

Screenshot from 2020-09-12 13-37-26

Testing

No plugin tests (yet).

It makes the developer experience slightly better, since if
you don't provide an empty object, you'll get the
`TypeError: Cannot read property 'mode' of undefined`.
@vercel
Copy link

vercel bot commented Sep 12, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/8sa8lr7aj
✅ Preview: https://snowpack-git-fork-ralphtheninja-plugin-webpack-optional-options.pikapkg.vercel.app

Copy link
Owner

@FredKSchott FredKSchott left a comment

Choose a reason for hiding this comment

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

+1, this was definitely the intention when this was built, thanks for catching that

@FredKSchott FredKSchott merged commit 3564ee5 into FredKSchott:master Sep 12, 2020
@ralphtheninja ralphtheninja deleted the plugin-webpack-optional-options branch September 12, 2020 20:07
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.

2 participants