Warn when running `deploy` without build if using build plugin that modifies config

Open
#3,792 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
cli

Research direction

Start by tracing the netlify build and netlify deploy flows when a build plugin mutates configuration, using the linked Next.js plugin issue as context. Determine whether normalized configuration can be persisted safely; otherwise, done means netlify deploy warns when a prior build changed configuration and suggests netlify deploy --build.

Written by the indexing model from the issue text.

Description

area: command: build area: command: deploy good first issue type: feature

Is your feature request related to a problem? Please describe.

Currently, if a use runs netlify build and then netlify deploy, any config changes made by a build plugin are lost because they are not persisted. This can be confusing. e.g. https://github.com/netlify/netlify-plugin-nextjs/issues/953

Describe the solution you'd like

The ideal would be if the config were persisted, so if build had been run then it would save the normalised config in .netlify, and if the other config was unchanged then it would deploy that instead. However if that isn't possible it would be good to add a warning if deploying after a build in which the config has been mutated, suggesting that the user run netlify deploy --build instead.

Describe alternatives you've considered

Add the same check in the build plugin itself.

Can you submit a pull request?

I can do this is if we think it's a good approach

Dominant language
TypeScript
Stars
1.9k
Forks
474
Avg merge
23h 30m
Merged PRs (30d)
53

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from netlify/cli

All issues in netlify/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.