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

Fail build when Webpack produces warnings or errors #1842

Merged
merged 3 commits into from
Dec 7, 2020

Conversation

DreierF
Copy link
Contributor

@DreierF DreierF commented Dec 6, 2020

Fixes #1527

Changes

This change makes the Snowpack build fail when Webpack produces errors.
It also adds an option to fail the build on warnings as well as that also often indicates some misconfiguration. Failure on warnings is however optional and is disabled by default to be non-breaking. I was not sure here whether this should be the default.

Testing

I tested it manually by linking the plugin against a snowpack build that succeeded despite having errors.
However the error message I returned in the reject method does not show up in the log. Is this expected?

Docs

I updated the docs of the plugin to reflect the new option.

@vercel
Copy link

vercel bot commented Dec 6, 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/pkq89zsxa
✅ Preview: https://snowpack-git-failwebpackonerror.pikapkg.vercel.app

@DreierF DreierF changed the title Fail build when WebPack produces warnings or errors Fail build when Webpack produces warnings or errors Dec 6, 2020
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 conceptually! Added two small comments on implementation

plugins/plugin-webpack/plugin.js Outdated Show resolved Hide resolved
plugins/plugin-webpack/README.md Outdated Show resolved Hide resolved
@FredKSchott
Copy link
Owner

No worries about the master branch, I believe those are outdated commits from back when we were juggling the old and new docs sites. We'll delete that branch as soon as all PRs are no longer targeting it.

@FredKSchott
Copy link
Owner

Thanks!

@FredKSchott FredKSchott merged commit bbcfa95 into FredKSchott:main Dec 7, 2020
@melissamcewen
Copy link
Contributor

Thank you so much!

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.

Webpack plugin errors do not crash the build
3 participants