ដេប្លយកម្មវិធី Vite របស់អ្នក
Vite is the build tool, not the framework — vanilla JS, React, Vue, Svelte, Preact, whatever you picked when you ran npm create vite. Every official template builds the same way and lands in the same folder.
- 01
Build the project
Run "npm run build". This runs "vite build" under the hood, bundling and minifying into static files.
- 02
Check the output folder
Vite writes to "dist" by default across every official template. If your vite.config sets build.outDir to something else, use that folder instead.
- 03
ដេប្លយវា
ដំណើរការ "npx harvis deploy dist" ពី root គម្រោងរបស់អ្នក។ មិនចាំបាច់ config និងមិនចាំបាច់ចូលសម្រាប់ deploy ដំបូងនេះទេ — អ្នកទទួលបាន URL ផ្ទាល់ភ្លាមៗ ព្រមទាំងតំណទាមទារឯកជនមួយ ដើម្បីភ្ជាប់គេហទំព័រទៅគណនីឥតគិតថ្លៃមួយនៅពេលណាដែលអ្នកត្រៀមខ្លួនរួចរាល់។
ដេប្លយ Vite ដោយពាក្យបញ្ជាតែមួយ
Build គម្រោងរបស់អ្នក រួចប្រគល់ថតលទ្ធផលទៅ harvis។ មិនចាំបាច់មានគណនីសម្រាប់ deploy ដំបូងទេ — អ្នកនឹងទទួលបានតំណភ្ជាប់ផ្ទាល់ និងតំណទាមទារឯកជនមួយ ដើម្បីគ្រប់គ្រងវានៅពេលក្រោយ។
npm run build npx harvis deploy dist
ចង់អូសឯកសារជំនួសឱ្យប្រើ terminal មែនទេ? Build គម្រោង រួច ទម្លាក់ថតលទ្ធផលនៅទីនេះ ហើយផ្សព្វផ្សាយវាតាមរបៀបដដែល។
Deploy Vite on every git push
The command above is one you will run again after every change. A git hook runs it for you: this one already points at dist, the folder Vite builds into.
The folder holding the finished site. "." is the repo root, which is right for hand-written HTML; a static-site generator writes somewhere else.
pre-push fires on every branch and every remote, so a feature branch would publish over your live site. With this on, a push from anywhere else exits early and goes through untouched.
cat > .git/hooks/pre-push <<'EOF' #!/bin/sh set -e npm run build harvis deploy dist EOF chmod +x .git/hooks/pre-push
The options, the gotchas and how to share a hook with your team are on the git hook page.
សំណួរអំពីការដេប្លយ Vite
Does it matter which Vite template I used?
Not to the deploy step. Vanilla, React, Vue, Svelte, Lit, Preact — they all end up as static files in dist. What changes between templates is what happens in your app; the hosting side is identical.
I have a multi-page Vite app (multiple entry HTML files). Does that work?
Yes. Vite's build.rollupOptions.input support for multiple entrypoints just produces more HTML files in dist, each one a normal page here — visit /about.html or whatever your entry files are named.
តើការដេប្លយកម្មវិធី Vite ទៅ harvis ឥតគិតថ្លៃពិតប្រាកដមែនទេ?
បាន មិនចាំបាច់ប្រើកាតទេ។ ដែនកំណត់ឥតគិតថ្លៃគឺឯកសារ ៥០០ និង ៥០ MB ក្នុងមួយគេហទំព័រ ដែលគ្រប់គ្រាន់សម្រាប់ build Vite static ដោយមានទំហំគ្រប់គ្រាន់។ គេហទំព័រដែលបានផ្សព្វផ្សាយមិនផុតកំណត់ទេ — ពួកវានៅតែដំណើរការរហូតដល់អ្នកលុបពួកវាចេញ។
តើខ្ញុំអាចប្រើ domain ផ្ទាល់ខ្លួនរបស់ខ្ញុំជាមួយគេហទំព័រ Vite ដែលបានដេប្លយបានទេ?
គេហទំព័រនីមួយៗទទួលបានអាសយដ្ឋាន harvis.page ឥតគិតថ្លៃមួយ ហើយអ្នកអាចជ្រើសរើស subdomain ផ្ទាល់ខ្លួនរបស់អ្នកពី dashboard បន្ទាប់ពីទាមទារវា — ដូចជា my-app.harvis.page ជំនួសឱ្យអាសយដ្ឋានចៃដន្យ។ ការចង្អុល domain ដែលអ្នកមានស្រាប់ (ដូចជា mystore.com) ទៅកាន់គេហទំព័រនេះមិនទាន់អាចធ្វើបានទេនៅឡើយ។
តើវាខុសពីការដេប្លយ Vite ទៅ Vercel ឬ Netlify យ៉ាងដូចម្តេច?
Vercel និង Netlify ត្រូវបានបង្កើតឡើងជុំវិញការភ្ជាប់ Git repo និងដំណើរការ build របស់អ្នកនៅលើ server របស់ពួកគេ ជាមួយ dashboard មួយសម្រាប់កំណត់រចនាសម្ព័ន្ធ។ harvis រំលងអ្វីៗទាំងនោះទាំងអស់៖ អ្នក build នៅមូលដ្ឋាន (ឬនៅក្នុង CI ផ្ទាល់ខ្លួនរបស់អ្នក) ដំណើរការពាក្យបញ្ជា CLI តែមួយប្រឆាំងនឹងថតលទ្ធផល រួចទទួលបានតំណភ្ជាប់មួយ — មិនចាំបាច់រៀបចំគម្រោង និងមិនចាំបាច់មានគណនីទេ រហូតដល់អ្នកចង់រក្សាគេហទំព័រនោះ។
កំពុងដេប្លយអ្វីផ្សេងទៀតមែនទេ?
រូបមន្តដូចគ្នាគ្រប់ទីកន្លែង — build វា រួច npx harvis deploy លទ្ធផល។