Skip to content

fix: handle empty publish directory #457

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

Merged
merged 2 commits into from
Jun 29, 2021
Merged

fix: handle empty publish directory #457

merged 2 commits into from
Jun 29, 2021

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Jun 29, 2021

Fixes a bug where if the publish dir was set to an empty string, then the plugin would think that the root of the Next site was a sibling of that, i.e. it was the directory above the repo root. This PR changes a few things. First, it adds specific handling for empty PUBLISH_DIR and netlifyConfig.build.publish values when running locally, as well as handling for when the publish dir is the site root. Ideally we'd fail if somebody sets the site root as the publish dir, like we do in the Gatsby plugin, but that would be a breaking change, so instead we work around it.

This fixes the issue that broke some sites after 3.5.0 was released.

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Jun 29, 2021
@ascorbic ascorbic force-pushed the fix/default-publish-dir branch 8 times, most recently from 1c1fef9 to 796c576 Compare June 29, 2021 13:30
@ascorbic ascorbic force-pushed the fix/default-publish-dir branch from 796c576 to dadc7fa Compare June 29, 2021 13:37
@ascorbic ascorbic changed the title fix: set default publish dir fix: handle empty publish directory Jun 29, 2021
@ascorbic ascorbic enabled auto-merge (squash) June 29, 2021 14:08
@ascorbic ascorbic requested a review from lindsaylevine June 29, 2021 14:08
Copy link

@lindsaylevine lindsaylevine left a comment

Choose a reason for hiding this comment

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

amazing!!!!

@ascorbic ascorbic merged commit 5064aa3 into main Jun 29, 2021
@ascorbic ascorbic deleted the fix/default-publish-dir branch June 29, 2021 14:39
serhalp pushed a commit that referenced this pull request Jun 13, 2024
Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com>
Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants