How to turn HTML, CSS And Javascript into static site?

Question:

I want to deploy this replit to a static site:
Processes3 - Replit

I click deployments, then click static site but it wants a public directory and build command.

What do I put in these?

Repl link/Link to where the bug appears:

Screenshots, links, or other helpful context:

code snippet

https://docs.replit.com/hosting/deployments/static-deployments#configuring-your-deployment

leave this blank since you aren’t using any generators / pre-processors

4 Likes

I put “./” as the public directory.

I get error when building:

2023-12-01T18:08:55Z fatal: could not create static archive

It might be trying to upload the hidden folders which could be too large :person_shrugging: Try moving the files you want to serve into a folder and using that folder as the public directory.

1 Like

I moved the html, css and javascript to a “public” directory and changed the paths in index.html to script.js and style.css and so on.

Unfortunately when I deploy, it works on the statically deployed domain here

https://processes3.replit.app/

but when I press “play” in replit IDE the javascript doesn’t load anymore unless i change it to include “public”

How do i get both the deployment and the local deployment to work?

  1. Click â‹® (in the sidebar) > Show hidden files
  2. Edit .replit file so it has
[hosting]
directory = "/public"
6 Likes

THANK YOU!

That fixed it. Thank you a lot UMARismyname :clinking_glasses:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.