SvelteKit static site deploy करें: static adapter path

अगर आपने deploy a SvelteKit static site खोजा है, तो आपको काम करते कोड से सार्वजनिक URL तक का सबसे छोटा और भरोसेमंद रास्ता चाहिए — सर्वर खड़े किए बिना, विशाल क्लाउड डैशबोर्ड सीखे बिना, या एक भी उपयोगकर्ता मिलने से पहले क्रेडिट कार्ड दर्ज किए बिना। यह गाइड बताती है कि jsdeck के साथ ठीक यही कैसे करें, trade-offs क्या हैं, और कब कोई दूसरा टूल वास्तव में बेहतर विकल्प है। हम इसे व्यावहारिक रखेंगे: असली कदम, असली कमांड, और ईमानदार चेतावनियाँ।
पूर्वापेक्षाएँ
- Node.js installed (या अपने framework के लिए relevant SDK)
- ऐसा प्रोजेक्ट जो static files में build हो (आमतौर पर
dist/,build/, याout/) - मुफ़्त jsdeck account — क्रेडिट कार्ड ज़रूरी नहीं
अगर प्रोजेक्ट locally चलता है और build folder बनाता है, तो आपके पास सब कुछ है।
static bundle बनाएँ
deploy a SvelteKit static site के पीछे मुख्य विचार: आपका framework सादे HTML, CSS, और JavaScript में compile होता है। production build चलाएँ (ज़्यादातर setups में npm run build) और output folder दिखे confirm करें। upload से पहले npx serve dist (folder name adjust करें) से locally verify करें।
चार चरणों में deploy
- Build:
npm run build - Sign up: मुफ़्त account बनाएँ
- Upload: output folder jsdeck dashboard में drag करें, या
jsdeck deployचलाएँ - Verify: अपना
*.jsdeck.comURL खोलें और navigation, deep links, refresh test करें
static hosts पर client-side routing
अगर ऐप client-side router उपयोग करता है, तो unknown paths को index.html पर rewrite होना चाहिए, वरना deep link refresh पर 404। jsdeck hosted apps के लिए SPA fallback automatically लगाता है, इसलिए React Router, Vue Router, और similar out of the box काम करते हैं। (underlying mechanics के लिए hub में routing fix guides देखें।)
Custom domain, HTTPS, और persistence
jsdeck subdomains के लिए HTTPS automatically provision होता है। production के लिए तैयार होने पर app dashboard से custom domain जोड़ें। कुछ store करना हो तो browser-only storage की बजाय datastore enable करें ताकि data devices और sessions में persist रहे।
static deploy troubleshooting
ज़्यादातर first-deploy problems कुछ कारणों से आते हैं। क्रम से देखें:
- Deploy के बाद blank page: आमतौर पर asset-path issue। bundler absolute paths (
/assets/...) emit करे लेकिन sub-path expect करे, तो build config में सहीbaseset कर rebuild करें। - Deep link refresh पर 404: ऊपर वाला SPA-fallback case — router history mode confirm करें और jsdeck के automatic rewrite पर भरोसा करें।
- पुराना version अभी भी दिख रहा: cached asset। bundlers filenames में content hashes जोड़ते हैं, fresh build plus hard refresh से resolve हो जाता है।
- Mixed-content warnings: हर request HTTPS use करे; jsdeck HTTPS पर serve करता है, इसलिए
http://resource browser block करेगा।
upload से पहले npm run preview से locally verify करने से लगभग हर बार round-trip बचता है।
यह किसके लिए है, और jsdeck कब न उपयोग करें
अच्छा fit: static frontends, single-page apps, demos, portfolios, MVPs, AI-generated exports, और ऐप्स जिन्हें थोड़ी JSON persistence या lightweight visitor login चाहिए।
fit नहीं: ऐप्स जिन्हें long-running Node server, request time पर server-side rendering, WebSocket backends, private server-side secrets, background jobs, या full relational database चाहिए। उनके लिए हमारे comparisons hub में चर्चा किए गए विकल्प बेहतर काम करेंगे — और यह जानबूझकर चुनने की विशेषता है, compromise नहीं।
अक्सर पूछे जाने वाले प्रश्न
क्या deploy a SvelteKit static site वास्तव में मुफ़्त है?
हाँ। jsdeck इस तरह के प्रोजेक्ट्स के लिए HTTPS के साथ मुफ़्त static hosting देता है, शुरू करने के लिए क्रेडिट कार्ड की ज़रूरत नहीं। datastore और visitor auth जैसी वैकल्पिक सुविधाएँ जब चाहिए तब उपलब्ध हैं।
क्या Git repository connect करनी होगी?
नहीं। dashboard में सीधे build folder upload कर सकते हैं, या jsdeck deploy से command line deploy करें। Git optional है।
क्या client-side routes refresh पर टूटेंगे?
नहीं। jsdeck SPA fallback लगाता है ताकि deep links और refresh 404 की बजाय आपके ऐप पर resolve हों।
अगले कदम
- static app hosting hub में और गाइड देखें
- अपना पहला ऐप deploy करने के लिए getting started guide अपनाएँ
- datastore, secure accounts (auth API), और CLI deploy details के लिए developer docs पढ़ें