Skip to content

Static space build docs #1742

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 11 commits into from
May 23, 2025
Merged

Static space build docs #1742

merged 11 commits into from
May 23, 2025

Conversation

coyotte508
Copy link
Member

cc @christophe-rannou @Michellehbn @julien-c @xenova @jbilcke-hf @mishig25 for viz

Also planning to add space templates

@coyotte508 coyotte508 requested a review from Copilot May 15, 2025 11:07
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the documentation for building static Spaces by introducing and explaining the new app_build_command and app_file configuration options.

  • Added a new section in spaces-sdks-static.md outlining how to build from source automatically.
  • Updated spaces-config-reference.md to include documentation for the new app_build_command configuration.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/hub/spaces-sdks-static.md Added instructions for automatically building static Spaces.
docs/hub/spaces-config-reference.md Added configuration reference for app_build_command and build process.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

coyotte508 and others added 2 commits May 15, 2025 14:38

## Adding a build step before serving

Static Spaces support adding a custom build step before serving your static assets. This is useful for frameworks like Next.js, SvelteKit, and others that require a build process before serving. The build command runs automatically when your Space is updated.
Copy link
Member Author

@coyotte508 coyotte508 May 15, 2025

Choose a reason for hiding this comment

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

Note that Next.js and sveltekit may not be the most appropriate as they specialize in SSR and need some config to build SPAs

(and https://huggingface.co/spaces/static-templates/sveltekit / https://static-templates-sveltekit.static.hf.space I don't know why it doesn't work 😬)

Copy link
Contributor

@gary149 gary149 May 15, 2025

Choose a reason for hiding this comment

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

mhh it should work with adapter static (didn't check the code)
ah ok https://huggingface.co/spaces/static-templates/sveltekit/blob/main/svelte.config.js idk

Copy link
Contributor

Choose a reason for hiding this comment

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

if it doesnt work for next.js/sveltekit we can rollaback the wording to react/svelte/vue

Copy link
Member

Choose a reason for hiding this comment

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

yes i would emphasize frontend only frameworks like React/Svelte/Vue

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

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

left a few suggestions

@coyotte508 coyotte508 merged commit 0442bc7 into main May 23, 2025
2 checks passed
@coyotte508 coyotte508 deleted the static-build branch May 23, 2025 11:57
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.

4 participants