@xnitor/sitevision-build-script
v1.0.8
Published
Will handle compilation and auto upload of resource files to Sitevision webdav.
Readme
@xnitor/sitevision-build-script
A CLI tool that builds and automatically uploads SiteVision resources via WebDAV.
Compiles TypeScript/SCSS with Parcel and supports both build and watch modes.
Use -p / --prod for production mode.
Requirements
- Node.js >= 18 (ESM,
chalk@5,inquirer@12, etc. require modern Node) - Access to SiteVision WebDAV (url, username, password)
Installation
Global:
npm install -g @xnitor/sitevision-build-scriptProject-local (dev):
npm install --save-dev @xnitor/sitevision-build-scriptQuickstart
Run build or watch (examples below).
Commands
Build (single build + upload)
npx svadv-build # development mode
npx svadv-build -p # production mode (sets NODE_ENV=production)Watch (continuous build + upload)
npx svadv-watch # development mode
npx svadv-watch -p # production mode (sets NODE_ENV=production)Flags
| Flag | Description |
|----------------|----------------------------------------------|
| -p, --prod | Run in production mode (NODE_ENV=production) |
| (default) | Runs in development mode if no flag is set |
Configuration
The tool expects a properties file in the project root for the selected environment.
If the file does not exist, it will be created automatically.
The naming convention is flexible, but it is common to use one file per environment
(e.g. dev_properties.json and prod_properties.json).
Example (dev_properties.json):
{
"webdavUrl": "https://example.sitevision.se",
"username": "user.name",
"password": "••••••••",
"webdavBaseUploadFolder": "system",
}Keys (common):
webdavUrl– full WebDAV URL to your SiteVision resourceusername/password– WebDAV loginwebdavBaseUploadFolder– folder in WebDAV where your built files will be placed
Tip: Add
*_properties.jsonto.gitignoreso that no secrets are included in the repo.
Project structure (expected)
The build step uses Parcel with a standard entry. Common layout:
src/
scripts/
index.ts # your JS/TS entry
sass/
style.scss # optional style entry if you use SCSSOutput is generated to dist/ and then uploaded to WebDAV.
dist/ does not need to be published to npm and is usually added to .gitignore.
Examples
Development build:
npx svadv-buildProduction build:
npx svadv-build -pDevelopment watch:
npx svadv-watchProduction watch:
npx svadv-watch -pLicense
ISC © Advania
