dist folder · Updated 2026-09-14 · Demox team

How do you deploy a dist folder?

Direct answer: A dist folder is a production static build. Demox hosts it if index.html sits at the root of the upload. Command: demox deploy ./dist. You can zip the folder and drag the ZIP into the web console. MCP agents can deploy the same folder. If index.html is nested in dist/public or dist/client, the upload is not a valid static site and you will see MISSING_ENTRYPOINT or INVALID_STATIC_SITE. Set the bundler base path for static hosting before you build.

How to do it

  1. Step 1. Run the project's production build.
  2. Step 2. Confirm dist/index.html exists.
  3. Step 3. Run demox deploy ./dist, or zip the folder and upload it.
  4. Step 4. Open the site and check CSS, JS, and client routes.

FAQ

Can I deploy the repo root?

No. Deploy the build output, not package.json and node_modules.

SPA routes 404 on refresh?

Demox keeps SPA fallback for hosted sites. Unknown document routes on www.demox.site stay real 404s.

怎样发布 dist 目录?

根目录必须有 index.html。执行 demox deploy ./dist,或把目录打成 ZIP 上传。不要上传源码仓库根目录。

按这个顺序做

  1. 01 执行项目的生产构建。
  2. 02 确认存在 dist/index.html。
  3. 03 执行 demox deploy ./dist,或把目录打 ZIP 上传。
  4. 04 打开站点,检查 CSS、JS 和前端路由。

常见问题

能上传仓库根目录吗?

不能。发布构建产物,不要上传 package.json 和 node_modules。

刷新 SPA 路由会 404 吗?

用户站点保留 SPA 回退。www.demox.site 上未知文档路径仍是真正的 404。

Related Demox pages

Upload and publish · Read the docs