Supported Frameworks
Sher supports the following frameworks out of the box:Vite
React, Vue, Svelte, and other Vite-based projects
Next.js
Automatically configured for static export
Astro
Static site generation
Create React App
Legacy React projects
How Framework Detection Works
Sher detects your framework by checking for specific configuration files in your project root:Vite
Checks for any of these files:vite.config.tsvite.config.jsvite.config.mjs
dist/
Next.js
Checks for any of these files:next.config.tsnext.config.jsnext.config.mjs
out/
Sher automatically configures Next.js for static export by injecting
output: "export" into your config file during the build. The original config is restored after the build completes.Astro
Checks for any of these files:astro.config.mjsastro.config.ts
dist/
Create React App
Checks forreact-scripts in your package.json dependencies or devDependencies.
Output directory: build/
Static Projects
If no framework is detected, Sher looks for pre-built directories in this order:dist/build/out/
Fallback Detection
As a last resort, Sher checks if yourpackage.json has a build script and assumes the output will be in dist/.
Next.js Static Export
Next.js projects require special configuration for static export. Sher handles this automatically:Automatic Configuration
When building a Next.js project, Sher:-
Injects static export configuration into your
next.configfile: -
Patches metadata files with
export const dynamic = "force-static"
app/ directory:
sitemap.tsrobots.tsmanifest.tsopengraph-image.tsxtwitter-image.tsxicon.tsx
- Restores original files after the build completes
Example Output
Package Manager Detection
Sher automatically detects which package manager to use by checking for lock files:| Lock File | Package Manager |
|---|---|
bun.lockb or bun.lock | Bun |
pnpm-lock.yaml | pnpm |
yarn.lock | Yarn |
| (none) | npm |
npm run build, yarn build, etc.).
Unsupported Frameworks
If your framework isn’t detected automatically, you have two options:1. Use the --dir flag
Skip detection and specify the output directory directly:
2. Use --no-build with a pre-built directory
Build your project manually, then share the output:
Best Practices
Ensure your build script is configured
Ensure your build script is configured
Sher runs
npm run build (or equivalent) to build your project. Make sure this script is defined in your package.json:Keep your output directory clean
Keep your output directory clean
Sher uploads everything in your output directory. Remove unnecessary files to reduce upload size:
Test your build locally first
Test your build locally first
Before sharing, verify your build works locally: