Skip to content

Deployments should fail when there are build errors #150

Closed
@ericselin

Description

@ericselin

Current behavior

When netlify-lambda build has an error (due to an error from webpack), we end up with a deployment on Netlify with no functions (functions dir empty due to webpack build failing).

Expected behavior

The whole deploy should fail.

Reproduction

Create a simple function that doesn't build (e.g. syntax error or whatever) and deploy through Netlify CI/CD.

Proposed solution

Add bail: true to the webpack configuration e.g. here:

devtool: false
This way, webpack returns a non-zero exit code when it has an error, and the deployment will fail.

This is what I have done myself via the custom webpack config option, but I think it would be a pretty sensible default to have! 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions