Introduction
This guide covers deploying Vite-powered applications on Shard Cloud. Vite is a fast build tool that supports React, Vue, Svelte, and vanilla JavaScript.Creating Your Project
Ensure you have Node.js and npm installed.Creating a New Vite Project
vanilla, vue, react, svelte, etc.
Building Your Project
Build the production output:dist/ folder with optimized static files.
Serving Your Vite App
Vite outputs static files that need a server:Using serve
package.json:
package.json
Using Express
Create aserver.js file:
server.js
Shard Cloud Configuration
Create a.shardcloud file:
.shardcloud
Deploying
1
Build Your Application
Run
npm run build to generate the dist folder.2
Prepare Your Files
Ensure you have:
- Source files
package.json.shardcloudvite.config.js
3
Exclude Unnecessary Files
Remove:
node_modules/, dist/, package-lock.json4
Create ZIP Archive
Compress your project folder.
5
Upload to Shard Cloud
Go to Shard Cloud Dashboard and upload.
Additional Resources
Visit the official Vite documentation for more information.Troubleshooting
Build fails
Build fails
- Check for syntax errors in your code
- Verify all imports are correct
Assets not loading
Assets not loading
Check your
base configuration in vite.config.js if using a subdirectory.